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
fdc05921
Commit
fdc05921
authored
Nov 03, 2012
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dart app: minor tweaks
parent
ae8c6a13
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
211 additions
and
233 deletions
+211
-233
labs/architecture-examples/dart/web/dart/TodoApp.dart
labs/architecture-examples/dart/web/dart/TodoApp.dart
+7
-12
labs/architecture-examples/dart/web/dart/TodoWidget.dart
labs/architecture-examples/dart/web/dart/TodoWidget.dart
+9
-13
labs/architecture-examples/dart/web/dart/app.dart.js
labs/architecture-examples/dart/web/dart/app.dart.js
+192
-205
labs/architecture-examples/dart/web/dart/app.dart.js.map
labs/architecture-examples/dart/web/dart/app.dart.js.map
+3
-3
No files found.
labs/architecture-examples/dart/web/dart/TodoApp.dart
View file @
fdc05921
...
@@ -23,7 +23,7 @@ class TodoApp {
...
@@ -23,7 +23,7 @@ class TodoApp {
}
}
void
initLocalStorage
()
{
void
initLocalStorage
()
{
var
jsonList
=
window
.
localStorage
[
"todos-vanilladart"
];
var
jsonList
=
window
.
localStorage
[
'todos-vanilladart'
];
if
(
jsonList
!=
null
)
{
if
(
jsonList
!=
null
)
{
try
{
try
{
var
todos
=
JSON
.
parse
(
jsonList
);
var
todos
=
JSON
.
parse
(
jsonList
);
...
@@ -31,7 +31,7 @@ class TodoApp {
...
@@ -31,7 +31,7 @@ class TodoApp {
addTodo
(
new
Todo
.
fromJson
(
todo
));
addTodo
(
new
Todo
.
fromJson
(
todo
));
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
window
.
console
.
log
(
"Could not load todos form local storage."
);
window
.
console
.
log
(
'Could not load todos form local storage.'
);
}
}
}
}
}
}
...
@@ -84,15 +84,10 @@ class TodoApp {
...
@@ -84,15 +84,10 @@ class TodoApp {
}
}
void
updateFooterDisplay
()
{
void
updateFooterDisplay
()
{
if
(
todoWidgets
.
length
==
0
)
{
var
display
=
todoWidgets
.
length
==
0
?
'none'
:
'block'
;
checkAllCheckboxElement
.
style
.
display
=
'none'
;
checkAllCheckboxElement
.
style
.
display
=
display
;
mainElement
.
style
.
display
=
'none'
;
mainElement
.
style
.
display
=
display
;
footerElement
.
style
.
display
=
'none'
;
footerElement
.
style
.
display
=
display
;
}
else
{
checkAllCheckboxElement
.
style
.
display
=
'block'
;
mainElement
.
style
.
display
=
'block'
;
footerElement
.
style
.
display
=
'block'
;
}
updateCounts
();
updateCounts
();
}
}
...
@@ -165,6 +160,6 @@ class TodoApp {
...
@@ -165,6 +160,6 @@ class TodoApp {
for
(
TodoWidget
todoWidget
in
todoWidgets
)
{
for
(
TodoWidget
todoWidget
in
todoWidgets
)
{
todos
.
add
(
todoWidget
.
todo
);
todos
.
add
(
todoWidget
.
todo
);
}
}
window
.
localStorage
[
"todos-vanilladart"
]
=
JSON
.
stringify
(
todos
);
window
.
localStorage
[
'todos-vanilladart'
]
=
JSON
.
stringify
(
todos
);
}
}
}
}
labs/architecture-examples/dart/web/dart/TodoWidget.dart
View file @
fdc05921
...
@@ -71,11 +71,7 @@ class TodoWidget {
...
@@ -71,11 +71,7 @@ class TodoWidget {
}
}
void
set
visible
(
bool
visible
)
{
void
set
visible
(
bool
visible
)
{
if
(
visible
)
{
element
.
style
.
display
=
visible
?
'block'
:
'none'
;
element
.
style
.
display
=
'block'
;
}
else
{
element
.
style
.
display
=
'none'
;
}
}
}
void
toggle
()
{
void
toggle
()
{
...
...
labs/architecture-examples/dart/web/dart/app.dart.js
View file @
fdc05921
This diff is collapsed.
Click to expand it.
labs/architecture-examples/dart/web/dart/app.dart.js.map
View file @
fdc05921
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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