Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
f2a26dc0
Commit
f2a26dc0
authored
Jun 16, 2011
by
Addy Osmani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing firefox issues related to new todo appending
parent
9ae927f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
39 deletions
+10
-39
index.html
index.html
+6
-1
todo-example/sammyjs/app.js
todo-example/sammyjs/app.js
+3
-36
todo-example/sammyjs/templates/404.template
todo-example/sammyjs/templates/404.template
+1
-2
No files found.
index.html
View file @
f2a26dc0
...
...
@@ -96,6 +96,7 @@ changes to code. At present, JavaScriptMVC is the only framework included which
<li><a
href=
"todo-example/spine/index.html"
>
Spine.js
</a></li>
<li><a
href=
"todo-example/sammyjs/index.html"
>
Sammy.js
</a></li>
<li><a
href=
"todo-example/knockoutjs/index.html"
>
KnockoutJS (MVVM)
</a></li>
<li><a
href=
"todo-example/sproutcore/index.html"
>
SproutCore
</a></li>
</ul>
</section>
<!-- /.widget -->
<section
class=
"widget"
>
<h4
class=
"widgettitle"
>
GitHub
</h4>
<ul>
<li><a
...
...
@@ -107,7 +108,11 @@ href="https://github.com/addyosmani/todomvc/">View repository</a></li> </ul>
href=
"http://twitter.com/addyosmani"
>
Addy Osmani
</a></li>
<li><a
href=
"http://twitter.com/justinbmeyer"
>
Justin Meyer
</a></li>
<li><a
href=
"http://twitter.com/jeromegn"
>
Jérôme Gravel-Niquet
</a></li>
<li><a
href=
"http://twitter.com/macmann"
>
Alex MacCaw
</a></li>
<li><a
href=
""
>
Ashish Sharma
</a></li>
</ul>
href=
"http://twitter.com/macmann"
>
Alex MacCaw
</a></li>
<li><a
href=
""
>
Ashish Sharma
</a></li>
<li><a
href=
"http://sproutcore.com"
>
Tom Dale, Yehuda Katz
</a></li>
</ul>
</section>
<!-- /.widget -->
...
...
todo-example/sammyjs/app.js
View file @
f2a26dc0
...
...
@@ -46,24 +46,14 @@
var
todoContent
=
$
(
this
).
val
();
var
todo
=
Todos
.
create
({
name
:
todoContent
,
done
:
false
,
listId
:
parseInt
(
$
(
'
h2
'
).
attr
(
'
data-id
'
),
10
)
});
context
.
partial
(
'
templates/_todo.template
'
,
todo
,
function
(
html
)
{
//$(html).insertAfter('#todo-list li:last');
var
q
=
$
(
html
);
console
.
log
(
q
);
$
(
'
#todo-list
'
).
append
(
q
);
$
(
'
#todo-list
'
).
append
(
html
);
});
$
(
this
).
val
(
''
);
}
});
/*
$('#lists')
.delegate('dd[data-id]', 'click', function() {
context.redirect('#/list/'+$(this).attr('data-id'));
app.trigger('updateList');
});*/
$
(
'
.trashcan
'
)
.
live
(
'
click
'
,
function
()
{
...
...
@@ -84,14 +74,7 @@
app
.
trigger
(
'
mark
'
+
(
isDone
?
'
Done
'
:
'
Undone
'
),
{
id
:
$li
.
attr
(
'
data-id
'
)
});
});
/*
$('.checkbox')
.live('click', function() {
var $this = $(this),
$li = $this.parents('li').toggleClass('done'),
isDone = $li.is('.done');
app.trigger('mark' + (isDone ? 'Done' : 'Undone'), { id: $li.attr('data-id') });
});*/
$
(
'
[contenteditable]
'
)
.
live
(
'
focus
'
,
function
()
{
...
...
@@ -145,7 +128,6 @@
this
.
redirect
(
lastViewedOrFirstList
);
}
//app.trigger('updateLists');
});
/*save the route as the lastviewed item*/
...
...
@@ -156,9 +138,7 @@
this
.
bind
(
'
save
'
,
function
(
e
,
data
)
{
var
model
=
data
.
type
==
'
todo
'
?
Todos
:
Lists
;
model
.
update
(
data
.
id
,
{
name
:
data
.
name
});
//if (data.type == 'list') {
//app.trigger('updateLists');
// }
});
/*marking the selected item as done*/
...
...
@@ -193,25 +173,12 @@
this
.
redirect
(
'
#/list/
'
+
listId
);
}
//app.trigger('updateLists');
}
else
{
// delete the todo from the view
$
(
'
li[data-id=
'
+
data
.
id
+
'
]
'
).
remove
();
}
// }
});
/*
this.bind('updateLists', function(e, data) {
var selected = parseInt(location.hash.substr(location.hash.lastIndexOf('/')+1), 10);
this.partial('templates/_lists.template', {
lists: Lists.getAll(),
selected: selected
}, function(html) {
$('#lists').html(html);
});
});*/
});
...
...
todo-example/sammyjs/templates/404.template
View file @
f2a26dc0
<h2>What?!</h2>
<p>Try clicking on one of your lists to the right.</p>
\ No newline at end of file
There was an error.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment