Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1406)

Unified Diff: static/js/main/main.js

Issue 108823002: chromium-status: improve status field editing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-status
Patch Set: fix up status __init__ Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | status.py » ('j') | status.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: static/js/main/main.js
diff --git a/static/js/main/main.js b/static/js/main/main.js
index 6e84d7d3648ad7d5ae126febc94f457f4fee5834..e0592613f9ac881137b4d351300cc480caf9faab 100644
--- a/static/js/main/main.js
+++ b/static/js/main/main.js
@@ -21,6 +21,7 @@ function help_init() {
message.onmouseover = help_show;
message.onmousemove = help_show;
message.onmouseout = help_hide;
+ message.onkeypress = auto_submit;
var help = document.getElementById('help');
help.onmouseover = help_show;
@@ -39,3 +40,19 @@ function help_hide() {
var help = document.getElementById('help');
help.hidden = true;
}
+
+/*
+ * Misc functions.
+ */
+
+// Used by the status field.
+function auto_submit(e) {
+ if (!e.shiftKey && e.keyCode == 13) {
+ // Catch the enter key in the textarea. Allow shift+enter to work
+ // so people editing a lot of text can play around with things.
+ var form = document.getElementsByName('add_new_message')[0]
+ form.submit();
+ return false;
+ }
+ return true;
+}
« no previous file with comments | « no previous file | status.py » ('j') | status.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698