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
43737b1a
Commit
43737b1a
authored
May 16, 2012
by
James Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing showing and hiding of page elements on items selected
parent
6dc4577e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
12 deletions
+22
-12
architecture-examples/dojo/css/app.css
architecture-examples/dojo/css/app.css
+10
-1
architecture-examples/dojo/index.html
architecture-examples/dojo/index.html
+5
-3
architecture-examples/dojo/js/todo/app.html
architecture-examples/dojo/js/todo/app.html
+0
-3
architecture-examples/dojo/js/todo/app.js
architecture-examples/dojo/js/todo/app.js
+7
-5
No files found.
architecture-examples/dojo/css/app.css
View file @
43737b1a
#clear-completed
,
#footer
,
#main
{
display
:
none
;
}
#todoapp
.todos_selected
#clear-completed
,
#todoapp
.todos_present
#footer
,
#todoapp
.todos_present
#main
{
display
:
inherit
;
}
#todo-list
li
.toggle.dijitChecked
:after
{
color
:
#85ada7
;
text-shadow
:
0
1px
0
#669991
;
...
...
@@ -5,7 +15,6 @@
position
:
relative
;
}
/* When checkbox is selected, score through todo item content */
.dijitCheckBoxChecked
+
.todo-content
{
color
:
#666
;
...
...
architecture-examples/dojo/index.html
View file @
43737b1a
...
...
@@ -13,9 +13,11 @@
</head>
<body
class=
"claro"
>
<section
id=
"todoapp"
data-dojo-type=
"todo.app"
></section>
<div
id=
"credits"
>
Created by
<a
href=
"http://jamesthom.as/"
>
James Thomas
</a>
and
<a
href=
"https://github.com/edchat"
>
Ed Chatelain
</a>
</div>
<footer
id=
"info"
>
<p>
Double-click to edit a todo
</p>
<p>
Created by
<a
href=
"http://jamesthom.as/"
>
James Thomas
</a>
and
<a
href=
"https://github.com/edchat"
>
Ed Chatelain
</a></p>
</footer>
<script
src=
"../../assets/base.js"
></script>
<script
data-dojo-config=
"async:true, parseOnLoad:true, locale:'en', paths:{'todo':'/code/JavaScript/todomvc/architecture-examples/dojo/js/todo/'}, deps:['dojo/parser', 'todo/app']"
src=
"/code/JavaScript/Libraries/DTK/dojo-release-1.7.2-src/dojo/dojo.js"
></script>
</body>
...
...
architecture-examples/dojo/js/todo/app.html
View file @
43737b1a
...
...
@@ -22,10 +22,7 @@
</ul>
</section>
<!-- This footer should hidden by default and shown when there are todos -->
<footer
id=
"footer"
data-dojo-attach-point=
"todo_stats"
>
<!-- This should be `0 items left` by default -->
<span
id=
"todo-count"
>
<strong>
<span
data-dojo-type=
"dojox.mvc.Output"
data-dojo-props=
"ref: this.model.incomplete"
class=
"number"
></span>
...
...
architecture-examples/dojo/js/todo/app.js
View file @
43737b1a
...
...
@@ -6,12 +6,14 @@ define(["dojo/_base/declare",
// Parent classes
"
dijit/_WidgetBase
"
,
"
dijit/_TemplatedMixin
"
,
"
dijit/_WidgetsInTemplateMixin
"
,
// General application modules
"
dojo/_base/lang
"
,
"
dojo/_base/event
"
,
"
dojo/on
"
,
"
dojo/dom-class
"
,
"
dojo/dom-attr
"
,
"
dojox/mvc
"
,
"
todo/model/TodoModel
"
,
"
dojo/_base/lang
"
,
"
dojo/_base/event
"
,
"
dojo/on
"
,
"
dojo/dom-class
"
,
"
dojo/dom-attr
"
,
"
dojo/keys
"
,
"
dojox/mvc
"
,
"
todo/model/TodoModel
"
,
// Widget template
"
dojo/text!./app.html
"
,
// Template Widgets
"
dijit/InlineEditBox
"
,
"
todo/form/CheckBox
"
,
"
dojox/mvc/Group
"
,
"
dojox/mvc/Repeat
"
,
"
dojox/mvc/Output
"
],
function
(
declare
,
_WidgetBase
,
_TemplatedMixin
,
_WidgetsInTemplateMixin
,
lang
,
_event
,
on
,
domClass
,
domAttr
,
mvc
,
TodoModel
,
template
)
{
function
(
declare
,
_WidgetBase
,
_TemplatedMixin
,
_WidgetsInTemplateMixin
,
lang
,
_event
,
on
,
domClass
,
domAttr
,
keys
,
mvc
,
TodoModel
,
template
)
{
return
declare
(
"
todo.app
"
,
[
_WidgetBase
,
_TemplatedMixin
,
_WidgetsInTemplateMixin
],
{
templateString
:
template
,
...
...
@@ -94,8 +96,8 @@ define(["dojo/_base/declare",
* we a number of completed and incomplete todo items.
*/
onItemStatusUpdate
:
function
()
{
domClass
.
toggle
(
this
.
todo_stats
,
"
item
s_selected
"
,
this
.
model
.
complete
.
value
>
0
);
domClass
.
toggle
(
this
.
todo_stats
,
"
item
s_present
"
,
this
.
model
.
todos
.
get
(
"
length
"
));
domClass
.
toggle
(
this
.
domNode
,
"
todo
s_selected
"
,
this
.
model
.
complete
.
value
>
0
);
domClass
.
toggle
(
this
.
domNode
,
"
todo
s_present
"
,
this
.
model
.
todos
.
get
(
"
length
"
));
},
/**
...
...
@@ -104,7 +106,7 @@ define(["dojo/_base/declare",
* text value as new todo item in the model.
*/
onKeyPress
:
function
(
event
)
{
if
(
event
.
keyCode
!==
13
)
return
;
if
(
event
.
keyCode
!==
keys
.
ENTER
)
return
;
this
.
addToModel
(
event
.
target
.
value
,
false
);
event
.
target
.
value
=
""
;
...
...
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