Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix examples not working #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/lifecycle-events/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var todos = [
];

function updateDOM() {
var todosHtml = todosTemplate.renderSync({ todos: todos });
var todosHtml = todosTemplate.renderSync({ todos: todos }).toString();
morphdom(document.getElementById('todos'), todosHtml, {
onNodeAdded: function(el) {
if (el.className === 'todo') {
Expand Down Expand Up @@ -52,4 +52,4 @@ window.handleRemoveTodoClick = function(el) {
updateDOM();
};

updateDOM();
updateDOM();
2 changes: 1 addition & 1 deletion examples/lifecycle-events/todos.marko
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<if (data.todos.length)>
<ul>
<for|todo| of=data.todos>
<li class=["todo", todo.visible && 'todo-visible'] id='todo${todo.id}'>
<li class=["todo", todo.visible && 'todo-visible'] id=`todo${todo.id}`>
<span class="todo-remove" onclick="window.handleRemoveTodoClick(this)" data-id=todo.id></span>
<span class="title">${todo.title}</span>
</li>
Expand Down
6 changes: 3 additions & 3 deletions examples/simple/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ window.updateDOM = function() {

if (state === 'before') {
state = 'after';
updatedHTML = contentAfterTemplate.renderSync();
updatedHTML = contentAfterTemplate.renderSync().toString();
} else {
state = 'before';
updatedHTML = contentBeforeTemplate.renderSync();
updatedHTML = contentBeforeTemplate.renderSync().toString();
}

morphdom(document.getElementById('container'), updatedHTML);

};
};
9 changes: 5 additions & 4 deletions examples/simple/content-after.marko
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
div#container
h2 - This is the <emphasis>after</emphasis> DOM
input type="text" value="bar"
div.animated.after - This DIV uses CSS transitions
<div id="container">
<h2>This is the <em>after</em> DOM</h2>
<input type="text" value="bar">
<div class="animated after">This DIV uses CSS transitions</div>
</div>
9 changes: 5 additions & 4 deletions examples/simple/content-before.marko
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
div#container
h2 - This is the <emphasis>before</emphasis> DOM
input type="text" value="foo"
div.animated.before - This DIV uses CSS transitions
<div id="container">
<h2>This is the <em>before</em> DOM</h2>
<input type="text" value="foo">
<div class="animated before">This DIV uses CSS transitions</div>
</div>