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
839abc9a
Commit
839abc9a
authored
Nov 09, 2011
by
goldledoigt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speed of rendering + show/hide clear button + css fix
parent
c3992424
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
13 deletions
+53
-13
todo-example/extjs/css/style.css
todo-example/extjs/css/style.css
+4
-1
todo-example/extjs/index.html
todo-example/extjs/index.html
+4
-1
todo-example/extjs/js/app.js
todo-example/extjs/js/app.js
+2
-4
todo-example/extjs/js/controller/Tasks.js
todo-example/extjs/js/controller/Tasks.js
+13
-4
todo-example/extjs/js/view/TaskField.js
todo-example/extjs/js/view/TaskField.js
+29
-2
todo-example/extjs/js/view/TaskToolbar.js
todo-example/extjs/js/view/TaskToolbar.js
+1
-1
No files found.
todo-example/extjs/css/style.css
View file @
839abc9a
...
...
@@ -21,6 +21,7 @@ div, h1, span {
h1
{
margin
:
0
;
line-height
:
1
;
font-size
:
36px
;
text-align
:
center
;
padding
:
20px
0
30px
;
...
...
@@ -58,9 +59,11 @@ input[type="text"] {
.row
span
{
cursor
:
pointer
;
margin-left
:
5px
;
}
.row
span
.checked
{
color
:
#777777
;
text-decoration
:
line-through
;
}
...
...
@@ -79,7 +82,7 @@ input[type="text"] {
.x-toolbar
button
{
float
:
right
;
width
:
1
2
0px
;
width
:
1
7
0px
;
border
:
0
none
;
color
:
#555555
;
cursor
:
pointer
;
...
...
todo-example/extjs/index.html
View file @
839abc9a
...
...
@@ -11,7 +11,10 @@
</head>
<body>
<div
id=
"todo"
></div>
<div
id=
"todo"
>
<h1>
Todos
</h1>
<input
type=
"text"
id=
"taskfield"
placeholder=
"What needs to be done?"
/>
</div>
<div
class=
"credits"
>
Credits:
<br
/><a
href=
"http://revolunet.com/"
>
Revolunet
</a>
</div>
...
...
todo-example/extjs/js/app.js
View file @
839abc9a
...
...
@@ -9,10 +9,8 @@ Ext.application({
Ext
.
create
(
'
Ext.container.Container
'
,
{
renderTo
:
'
todo
'
,
items
:
[{
xtype
:
'
container
'
,
html
:
'
<h1>Todos</h1>
'
},
{
xtype
:
'
taskField
'
xtype
:
'
taskField
'
,
contentEl
:
'
taskfield
'
},
{
xtype
:
'
taskList
'
},
{
...
...
todo-example/extjs/js/controller/Tasks.js
View file @
839abc9a
...
...
@@ -63,21 +63,30 @@ Ext.define('Todo.controller.Tasks', {
},
onStoreDataChanged
:
function
()
{
var
info
=
''
,
var
info
=
''
,
text
=
''
,
store
=
this
.
getTasksStore
(),
totalCount
=
store
.
getCount
(),
toolbar
=
this
.
getTaskToolbar
(),
button
=
toolbar
.
items
.
first
(),
container
=
toolbar
.
items
.
last
(),
records
=
store
.
queryBy
(
function
(
record
)
{
return
!
record
.
get
(
'
checked
'
);
}),
count
=
records
.
getCount
();
count
=
records
.
getCount
(),
checkedCount
=
totalCount
-
count
;
if
(
count
)
{
info
=
count
+
'
item
'
+
(
count
>
1
?
'
s
'
:
''
)
+
'
left.
'
;
info
=
'
<b>
'
+
count
+
'
</b> item
'
+
(
count
>
1
?
'
s
'
:
''
)
+
'
left.
'
;
}
if
(
checkedCount
)
{
text
=
'
Clear
'
+
checkedCount
+
'
completed item
'
+
(
checkedCount
>
1
?
'
s
'
:
''
);
}
container
.
update
(
info
);
toolbar
.
setVisible
(
store
.
getCount
());
button
.
setText
(
text
);
button
.
setVisible
(
checkedCount
);
toolbar
.
setVisible
(
totalCount
);
}
});
todo-example/extjs/js/view/TaskField.js
View file @
839abc9a
Ext
.
define
(
'
Todo.view.TaskField
'
,
{
enableKeyEvents
:
true
,
alias
:
'
widget.taskField
'
,
extend
:
'
Ext.form.TextField
'
,
emptyText
:
'
What needs to be done?
'
extend
:
'
Ext.Component
'
,
emptyText
:
'
What needs to be done?
'
,
afterRender
:
function
()
{
this
.
callParent
(
arguments
);
this
.
field
=
this
.
el
.
first
();
this
.
field
.
on
(
'
keyup
'
,
this
.
onKeyup
,
this
);
},
onKeyup
:
function
(
event
)
{
this
.
fireEvent
(
'
keyup
'
,
this
,
event
);
},
getValue
:
function
()
{
return
this
.
field
.
dom
.
value
;
},
setValue
:
function
(
value
)
{
this
.
field
.
dom
.
value
=
value
;
},
reset
:
function
()
{
this
.
setValue
(
''
);
}
});
todo-example/extjs/js/view/TaskToolbar.js
View file @
839abc9a
...
...
@@ -4,7 +4,7 @@ Ext.define('Todo.view.TaskToolbar' , {
alias
:
'
widget.taskToolbar
'
,
items
:
[{
xtype
:
'
button
'
,
text
:
'
Clear completed
'
hidden
:
true
},
{
xtype
:
'
container
'
}]
...
...
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