projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add handler to close post widget on ESC
[blerg.git]
/
www
/
jssrc
/
blerg
/
Post.js
diff --git
a/www/jssrc/blerg/Post.js
b/www/jssrc/blerg/Post.js
index
f39520e
..
221d56a
100644
(file)
--- a/
www/jssrc/blerg/Post.js
+++ b/
www/jssrc/blerg/Post.js
@@
-5,7
+5,8
@@
enyo.kind({
handlers: {
onPostVisibility: "postVisibilityUpdate",
onLogin: "loggedIn",
handlers: {
onPostVisibility: "postVisibilityUpdate",
onLogin: "loggedIn",
- onLogout: "loggedOut"
+ onLogout: "loggedOut",
+ onkeydown: "keyHandler"
},
components: [
{tag: "h2", content: "What's on your mind?"},
},
components: [
{tag: "h2", content: "What's on your mind?"},
@@
-93,6
+94,7
@@
enyo.kind({
this.$.toolbar.reflow();
this.reflow();
} else {
this.$.toolbar.reflow();
this.reflow();
} else {
+ this.$.postContent.node.blur();
setTimeout(function() {
this.hide();
this.removeClass('exit');
setTimeout(function() {
this.hide();
this.removeClass('exit');
@@
-132,4
+134,9
@@
enyo.kind({
this.loadHelp();
}
},
this.loadHelp();
}
},
+ keyHandler: function(inSender, inEvent) {
+ if (inEvent.which == 27) {
+ this.closePost();
+ }
+ }
});
});