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
7c80642e
Commit
7c80642e
authored
Jan 19, 2012
by
James Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from neonstalwart/tweaks
minor tweaks to code
parents
973b3c70
c4c8e3ee
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
61 deletions
+53
-61
todo-example/dojo/index.html
todo-example/dojo/index.html
+2
-5
todo-example/dojo/js/todo/app.html
todo-example/dojo/js/todo/app.html
+2
-3
todo-example/dojo/js/todo/app.js
todo-example/dojo/js/todo/app.js
+25
-25
todo-example/dojo/js/todo/model/TodoModel.js
todo-example/dojo/js/todo/model/TodoModel.js
+20
-24
todo-example/dojo/js/todo/store/LocalStorage.js
todo-example/dojo/js/todo/store/LocalStorage.js
+4
-4
No files found.
todo-example/dojo/index.html
View file @
7c80642e
...
...
@@ -7,10 +7,7 @@
@import
"./css/claro.css"
;
</style>
<link
href=
"css/todos.css"
media=
"all"
rel=
"stylesheet"
type=
"text/css"
/>
<script
data-dojo-config=
"async:true, parseOnLoad:true, paths:{'todo':'../../todo'}"
src=
"./js/dtk/dojo/dojo.js"
></script>
<script>
require
([
"
dojo/parser
"
,
"
todo/app
"
])
</script>
<script
data-dojo-config=
"async:true, parseOnLoad:true, paths:{'todo':'../../todo'}, deps:['dojo/parser', 'todo/app']"
src=
"./js/dtk/dojo/dojo.js"
></script>
</head>
<body
class=
"claro"
>
...
...
todo-example/dojo/js/todo/app.html
View file @
7c80642e
...
...
@@ -9,7 +9,6 @@
<li
data-dojo-type=
"dojox.mvc.Group"
data-dojo-props=
"ref: '#{this.index}'"
>
<div
class=
"todo"
>
<input
class=
"check"
data-dojo-type=
"todo.form.CheckBox"
data-dojo-props=
'ref: "isDone"'
style=
"display:inline-block"
>
</input>
<div
class=
"todo-content dijitInline"
data-dojo-type=
"dijit.InlineEditBox"
data-dojo-props=
'ref: "todo_text", editor:"dijit.form.TextBox", autosave:true, width:"420px", style:"width:420px;"'
></div>
...
...
todo-example/dojo/js/todo/app.js
View file @
7c80642e
...
...
@@ -94,8 +94,8 @@ define(["dojo/_base/declare",
* we a number of completed and incomplete todo items.
*/
onItemStatusUpdate
:
function
()
{
domClass
[
this
.
model
.
complete
.
value
>
0
?
"
add
"
:
"
remove
"
](
this
.
todo_stats
,
"
items_selected
"
);
domClass
[
this
.
model
.
todos
.
get
(
"
length
"
)
?
"
add
"
:
"
remove
"
](
this
.
todo_stats
,
"
items_present
"
);
domClass
.
toggle
(
this
.
todo_stats
,
"
items_selected
"
,
this
.
model
.
complete
.
value
>
0
);
domClass
.
toggle
(
this
.
todo_stats
,
"
items_present
"
,
this
.
model
.
todos
.
get
(
"
length
"
)
);
},
/**
...
...
todo-example/dojo/js/todo/model/TodoModel.js
View file @
7c80642e
...
...
@@ -88,13 +88,9 @@ define(["dojo/_base/declare", "dojox/mvc/StatefulModel", "todo/store/LocalStorag
* cause the bound "complete" value to be updated as well.
*/
updateTotalItemsLeft
:
function
()
{
var
remaining
=
0
;
array
.
forEach
(
this
.
todos
,
function
(
item
)
{
item
&&
!
item
.
isDone
.
value
&&
remaining
++
;
});
this
.
incomplete
.
set
(
"
value
"
,
remaining
);
this
.
incomplete
.
set
(
"
value
"
,
array
.
filter
(
this
.
todos
,
function
(
item
)
{
return
item
&&
!
item
.
isDone
.
value
;
}).
length
);
}
});
});
todo-example/dojo/js/todo/store/LocalStorage.js
View file @
7c80642e
...
...
@@ -53,7 +53,7 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dojo/_base/json", "dojo/store/
// property if a specific id is to be used.
// returns: Number
var
id
=
options
&&
options
.
id
||
object
[
this
.
idProperty
]
||
Math
.
random
();
localStorage
.
setItem
(
id
,
dojo
.
toJson
(
object
));
localStorage
.
setItem
(
id
,
json
.
toJson
(
object
));
return
id
;
},
add
:
function
(
object
,
options
){
...
...
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