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
Eugene Shen
todomvc
Commits
2ec5dc11
Commit
2ec5dc11
authored
Aug 02, 2013
by
Stephen Sawchuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spine .focus() spec deviation.
parent
92328d50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
14 deletions
+10
-14
architecture-examples/spine/js/app.js
architecture-examples/spine/js/app.js
+4
-7
architecture-examples/spine/js/controllers/todos.js
architecture-examples/spine/js/controllers/todos.js
+4
-4
architecture-examples/spine/js/models/todo.js
architecture-examples/spine/js/models/todo.js
+1
-2
architecture-examples/spine/src/controllers/todos.coffee
architecture-examples/spine/src/controllers/todos.coffee
+1
-1
No files found.
architecture-examples/spine/js/app.js
View file @
2ec5dc11
// Generated by CoffeeScript 1.6.
2
// Generated by CoffeeScript 1.6.
3
(
function
()
{
(
function
()
{
var
TodoApp
,
var
TodoApp
,
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
...
@@ -33,7 +33,8 @@
...
@@ -33,7 +33,8 @@
this
.
renderFooter
=
__bind
(
this
.
renderFooter
,
this
);
this
.
renderFooter
=
__bind
(
this
.
renderFooter
,
this
);
this
.
toggleElems
=
__bind
(
this
.
toggleElems
,
this
);
this
.
toggleElems
=
__bind
(
this
.
toggleElems
,
this
);
this
.
addAll
=
__bind
(
this
.
addAll
,
this
);
this
.
addAll
=
__bind
(
this
.
addAll
,
this
);
this
.
addNew
=
__bind
(
this
.
addNew
,
this
);
TodoApp
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
this
.
addNew
=
__bind
(
this
.
addNew
,
this
);
TodoApp
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
Todo
.
bind
(
'
create
'
,
this
.
addNew
);
Todo
.
bind
(
'
create
'
,
this
.
addNew
);
Todo
.
bind
(
'
refresh change
'
,
this
.
addAll
);
Todo
.
bind
(
'
refresh change
'
,
this
.
addAll
);
Todo
.
bind
(
'
refresh change
'
,
this
.
toggleElems
);
Todo
.
bind
(
'
refresh change
'
,
this
.
toggleElems
);
...
@@ -54,7 +55,6 @@
...
@@ -54,7 +55,6 @@
TodoApp
.
prototype
[
"
new
"
]
=
function
(
e
)
{
TodoApp
.
prototype
[
"
new
"
]
=
function
(
e
)
{
var
val
;
var
val
;
val
=
$
.
trim
(
this
.
newTodoInput
.
val
());
val
=
$
.
trim
(
this
.
newTodoInput
.
val
());
if
(
e
.
which
===
ENTER_KEY
&&
val
)
{
if
(
e
.
which
===
ENTER_KEY
&&
val
)
{
Todo
.
create
({
Todo
.
create
({
...
@@ -77,7 +77,6 @@
...
@@ -77,7 +77,6 @@
TodoApp
.
prototype
.
addNew
=
function
(
todo
)
{
TodoApp
.
prototype
.
addNew
=
function
(
todo
)
{
var
view
;
var
view
;
view
=
new
Todos
({
view
=
new
Todos
({
todo
:
todo
todo
:
todo
});
});
...
@@ -86,7 +85,6 @@
...
@@ -86,7 +85,6 @@
TodoApp
.
prototype
.
addAll
=
function
()
{
TodoApp
.
prototype
.
addAll
=
function
()
{
var
todo
,
_i
,
_len
,
_ref
,
_results
;
var
todo
,
_i
,
_len
,
_ref
,
_results
;
this
.
todos
.
empty
();
this
.
todos
.
empty
();
_ref
=
this
.
getByFilter
();
_ref
=
this
.
getByFilter
();
_results
=
[];
_results
=
[];
...
@@ -103,6 +101,7 @@
...
@@ -103,6 +101,7 @@
TODO: Model updateAttribute sometimes won't stick:
TODO: Model updateAttribute sometimes won't stick:
https://github.com/maccman/spine/issues/219
https://github.com/maccman/spine/issues/219
*/
*/
todo
.
updateAttribute
(
'
completed
'
,
e
.
target
.
checked
);
todo
.
updateAttribute
(
'
completed
'
,
e
.
target
.
checked
);
return
todo
.
trigger
(
'
update
'
,
todo
);
return
todo
.
trigger
(
'
update
'
,
todo
);
});
});
...
@@ -114,7 +113,6 @@
...
@@ -114,7 +113,6 @@
TodoApp
.
prototype
.
toggleElems
=
function
()
{
TodoApp
.
prototype
.
toggleElems
=
function
()
{
var
isTodos
;
var
isTodos
;
isTodos
=
!!
Todo
.
count
();
isTodos
=
!!
Todo
.
count
();
this
.
main
.
toggle
(
isTodos
);
this
.
main
.
toggle
(
isTodos
);
this
.
footer
.
toggle
(
isTodos
);
this
.
footer
.
toggle
(
isTodos
);
...
@@ -126,7 +124,6 @@
...
@@ -126,7 +124,6 @@
TodoApp
.
prototype
.
renderFooter
=
function
()
{
TodoApp
.
prototype
.
renderFooter
=
function
()
{
var
active
,
completed
,
text
;
var
active
,
completed
,
text
;
text
=
function
(
count
)
{
text
=
function
(
count
)
{
if
(
count
===
1
)
{
if
(
count
===
1
)
{
return
'
item
'
;
return
'
item
'
;
...
...
architecture-examples/spine/js/controllers/todos.js
View file @
2ec5dc11
// Generated by CoffeeScript 1.6.
2
// Generated by CoffeeScript 1.6.
3
(
function
()
{
(
function
()
{
var
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
var
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
__hasProp
=
{}.
hasOwnProperty
,
__hasProp
=
{}.
hasOwnProperty
,
...
@@ -26,7 +26,8 @@
...
@@ -26,7 +26,8 @@
};
};
function
Todos
()
{
function
Todos
()
{
this
.
render
=
__bind
(
this
.
render
,
this
);
Todos
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
this
.
render
=
__bind
(
this
.
render
,
this
);
Todos
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
this
.
todo
.
bind
(
'
update
'
,
this
.
render
);
this
.
todo
.
bind
(
'
update
'
,
this
.
render
);
this
.
todo
.
bind
(
'
destroy
'
,
this
.
release
);
this
.
todo
.
bind
(
'
destroy
'
,
this
.
release
);
}
}
...
@@ -46,12 +47,11 @@
...
@@ -46,12 +47,11 @@
Todos
.
prototype
.
edit
=
function
()
{
Todos
.
prototype
.
edit
=
function
()
{
this
.
el
.
addClass
(
'
editing
'
);
this
.
el
.
addClass
(
'
editing
'
);
return
this
.
editElem
.
focus
();
return
this
.
editElem
.
val
(
this
.
editElem
.
val
()).
focus
();
};
};
Todos
.
prototype
.
finishEdit
=
function
()
{
Todos
.
prototype
.
finishEdit
=
function
()
{
var
val
;
var
val
;
this
.
el
.
removeClass
(
'
editing
'
);
this
.
el
.
removeClass
(
'
editing
'
);
val
=
$
.
trim
(
this
.
editElem
.
val
());
val
=
$
.
trim
(
this
.
editElem
.
val
());
if
(
val
)
{
if
(
val
)
{
...
...
architecture-examples/spine/js/models/todo.js
View file @
2ec5dc11
// Generated by CoffeeScript 1.6.
2
// Generated by CoffeeScript 1.6.
3
(
function
()
{
(
function
()
{
var
_ref
,
var
_ref
,
__hasProp
=
{}.
hasOwnProperty
,
__hasProp
=
{}.
hasOwnProperty
,
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
Todo
.
destroyCompleted
=
function
()
{
Todo
.
destroyCompleted
=
function
()
{
var
todo
,
_i
,
_len
,
_ref1
,
_results
;
var
todo
,
_i
,
_len
,
_ref1
,
_results
;
_ref1
=
this
.
completed
();
_ref1
=
this
.
completed
();
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref1
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref1
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
architecture-examples/spine/src/controllers/todos.coffee
View file @
2ec5dc11
...
@@ -29,7 +29,7 @@ class window.Todos extends Spine.Controller
...
@@ -29,7 +29,7 @@ class window.Todos extends Spine.Controller
edit
:
->
edit
:
->
@
el
.
addClass
'editing'
@
el
.
addClass
'editing'
@
editElem
.
focus
()
@
editElem
.
val
(
@
editElem
.
val
()).
focus
()
finishEdit
:
->
finishEdit
:
->
@
el
.
removeClass
'editing'
@
el
.
removeClass
'editing'
...
...
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