Skip to content

Commit

Permalink
Fix examples not working
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanfisk committed Sep 27, 2021
1 parent 84f28d0 commit 30e9d7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
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>

0 comments on commit 30e9d7f

Please sign in to comment.