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

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: replace newlines with spaces Created 6 years, 9 months 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') | no next file with comments »
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 69a19f170893bbea5ce3536bca7661faca374544..161b1614ba6f5b3473688fa8a6ecd5b1c1fcf79e 100644
--- a/static/js/main/main.js
+++ b/static/js/main/main.js
@@ -82,6 +82,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;
@@ -100,3 +101,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698