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
594c7679
Commit
594c7679
authored
Jun 26, 2014
by
Duilio Protti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ariatemplates - cancel editing on escape keypress
parent
1d9089af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
labs/architecture-examples/ariatemplates/js/view/Todo.tpl
labs/architecture-examples/ariatemplates/js/view/Todo.tpl
+1
-1
labs/architecture-examples/ariatemplates/js/view/TodoScript.js
...architecture-examples/ariatemplates/js/view/TodoScript.js
+11
-1
No files found.
labs/architecture-examples/ariatemplates/js/view/Todo.tpl
View file @
594c7679
...
...
@@ -107,7 +107,7 @@
<input
class=
"edit"
value=
"$
{
iter
.
item
.
title
|
escapeForHTML
}
"
{
id
"editbox"
/
}
{
on
blur
{
fn
:
"stopEdit"
,
scope
:
this
,
args
:
iter
}
/
}
{
on
keydown
{
fn
:
"confirmEdit"
,
scope
:
this
,
args
:
iter
}
/
}
>
{
on
keydown
{
fn
:
"confirm
OrRevert
Edit"
,
scope
:
this
,
args
:
iter
}
/
}
>
{
else
/
}
<div
class=
"view"
>
{@html:CheckBox {
...
...
labs/architecture-examples/ariatemplates/js/view/TodoScript.js
View file @
594c7679
...
...
@@ -83,8 +83,9 @@ Aria.tplScriptDefinition({
this
.
$focus
(
'
editbox
'
);
},
confirmEdit
:
function
(
evt
,
e
)
{
confirm
OrRevert
Edit
:
function
(
evt
,
e
)
{
if
(
evt
.
keyCode
===
evt
.
KC_ENTER
)
{
this
.
stopEdit
(
evt
,
e
);
}
if
(
evt
.
keyCode
===
evt
.
KC_ESCAPE
)
{
this
.
revertEdit
(
evt
,
e
);
}
},
stopEdit
:
function
(
evt
,
e
)
{
...
...
@@ -106,6 +107,15 @@ Aria.tplScriptDefinition({
}
},
revertEdit
:
function
(
evt
,
e
)
{
var
el
;
this
.
data
.
editedTask
=
null
;
el
=
this
.
$getElementById
(
e
.
sectionId
);
if
(
el
)
{
el
.
classList
.
remove
(
'
editing
'
);
}
this
.
$refresh
({
outputSection
:
e
.
sectionId
});
this
.
$json
.
setValue
(
e
.
item
,
'
title
'
,
e
.
item
.
title
);
},
todolistUpdateHandler
:
function
()
{
var
size
;
if
(
this
.
pauselistener
)
{
return
;
}
...
...
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