Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[livejournal] r18802: LJSV-1426: Incorrect behavior when sendi...

Committer: pkornilov
LJSV-1426: Incorrect behavior when sending private message
U   trunk/htdocs/js/jquery_fn.js
Modified: trunk/htdocs/js/jquery_fn.js
===================================================================
--- trunk/htdocs/js/jquery_fn.js	2011-04-06 04:15:19 UTC (rev 18801)
+++ trunk/htdocs/js/jquery_fn.js	2011-04-06 04:31:58 UTC (rev 18802)
@@ -173,9 +173,13 @@
 	this.bind("keypress", function(e) {
 		// keyCode == 10 in IE with ctrlKey
 		if ((e.which === 13 || e.which === 10) && e.target && e.target.form) {
-			if (e.target.tagName === "TEXTAREA" && e.ctrlKey && !jQuery(":submit", e.target.form).attr("disabled")) {
+			if (e.ctrlKey && !jQuery(":submit", e.target.form).attr("disabled")
+				&& (e.target.tagName === "TEXTAREA" || e.target.tagName === "INPUT")
+			) {
 				e.target.form.submit();
-			} else if (e.target.type === "text" && !e.ctrlKey) { // for input:text
+			}
+
+			if (e.target.tagName === "INPUT") {
 				e.preventDefault();
 			}
 		}

Tags: js, livejournal, lusever
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments