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
1c2abb79
Commit
1c2abb79
authored
May 10, 2015
by
Arthur Verschaeve
Committed by
Sindre Sorhus
May 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close #1292 PR: Componentjs: Minor cleanup.
parent
9c6ae435
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
57 deletions
+54
-57
examples/componentjs/app/app-ui-composite-main.js
examples/componentjs/app/app-ui-composite-main.js
+1
-1
examples/componentjs/app/app-ui-widget-todo-model.js
examples/componentjs/app/app-ui-widget-todo-model.js
+1
-2
examples/componentjs/app/app-ui-widget-todo-view.js
examples/componentjs/app/app-ui-widget-todo-view.js
+5
-7
examples/componentjs/index.html
examples/componentjs/index.html
+47
-47
No files found.
examples/componentjs/app/app-ui-composite-main.js
View file @
1c2abb79
/* global cs, app, Router, $
, _
*/
/* global cs, app, Router, $ */
(
function
()
{
'
use strict
'
;
...
...
examples/componentjs/app/app-ui-widget-todo-model.js
View file @
1c2abb79
...
...
@@ -50,8 +50,7 @@
cs
(
self
).
value
(
'
data:status-items-remaining
'
,
remaining
);
if
(
remaining
===
0
&&
completed
>
0
)
{
cs
(
self
).
value
(
'
state:all-item-selected
'
,
true
);
}
else
if
(
remaining
>
0
)
{
}
else
if
(
remaining
>
0
)
{
cs
(
self
).
value
(
'
state:all-item-selected
'
,
false
);
}
}
...
...
examples/componentjs/app/app-ui-widget-todo-view.js
View file @
1c2abb79
...
...
@@ -63,8 +63,7 @@
if
(
items
.
length
===
0
)
{
$
(
'
.todo__main
'
,
ui
).
addClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
addClass
(
'
hidden
'
);
}
else
{
}
else
{
$
(
'
.todo__main
'
,
ui
).
removeClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
removeClass
(
'
hidden
'
);
}
...
...
@@ -79,7 +78,7 @@
// one-way bind key-press and field blur interactions to leave editing mode
var
blur
=
function
(
el
,
takeTitle
)
{
var
id
=
$
(
el
).
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
el
).
parent
().
data
(
'
id
'
))
;
$
(
el
).
parent
().
removeClass
(
'
editing
'
);
if
(
takeTitle
)
{
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
...
...
@@ -109,7 +108,7 @@
// one-way bind click interaction to toggle item completion
$
(
'
.todo__toggle
'
,
ui
).
click
(
function
(
ev
)
{
var
id
=
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
))
;
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
item
=
_
.
find
(
items
,
{
id
:
id
});
item
.
completed
=
!
item
.
completed
;
...
...
@@ -119,7 +118,7 @@
// one-way bind click interaction to remove item
$
(
'
.todo__destroy
'
,
ui
).
click
(
function
(
ev
)
{
var
id
=
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
))
;
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
item
=
_
.
find
(
items
,
{
id
:
id
});
cs
(
self
).
value
(
'
data:item-list
'
,
_
.
without
(
items
,
item
));
...
...
@@ -167,8 +166,7 @@
if
(
value
>
0
)
{
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
block
'
);
$
(
'
*[data-bind=
\'
data:status-items-completed
\'
]
'
,
ui
).
text
(
value
);
}
else
{
}
else
{
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
none
'
);
}
}
...
...
examples/componentjs/index.html
View file @
1c2abb79
...
...
@@ -16,7 +16,7 @@
<!-- load and call application initialization code -->
<script
src=
"app/app.js"
></script>
<script
type=
"text/javascript"
>
app
.
boot
.
init
()
</script>
<script
>
app
.
boot
.
init
()
</script>
<!-- load the service and datamodel parts -->
<script
src=
"app/app-dm.js"
></script>
...
...
@@ -25,25 +25,25 @@
<!-- load the root UI component -->
<script
src=
"app/app-ui-constants.js"
></script>
<script
src=
"app/app-ui-composite-root.js"
></script>
<link
href=
"app/app-ui-composite-root-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-composite-root-style.css"
rel=
"stylesheet
"
>
<!-- load the main UI component -->
<script
src=
"app/app-ui-composite-main.js"
></script>
<link
href=
"app/app-ui-composite-main-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-composite-main-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-composite-main-style.css"
rel=
"stylesheet
"
>
<!-- load the todo UI component -->
<script
src=
"app/app-ui-widget-todo-view.js"
></script>
<script
src=
"app/app-ui-widget-todo-model.js"
></script>
<link
href=
"app/app-ui-widget-todo-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-widget-todo-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-widget-todo-style.css"
rel=
"stylesheet
"
>
<!-- load required todomvc.com integration functions -->
<link
href=
"bower_components/todomvc-common/base.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"bower_components/todomvc-common/base.css"
rel=
"stylesheet
"
>
<script
src=
"bower_components/todomvc-common/base.js"
></script>
<!-- call application main code -->
<script
type=
"text/javascript"
>
app
.
boot
.
main
()
</script>
<script
>
app
.
boot
.
main
()
</script>
</head>
<body>
</body>
...
...
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