can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r17423: LJSV-1130: localize fix code for opera

Committer: dpetrov
LJSV-1130: localize fix code for opera
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2010-09-21 08:08:11 UTC (rev 17422)
+++ trunk/htdocs/js/entry.js	2010-09-21 08:30:13 UTC (rev 17423)
@@ -540,25 +540,30 @@
 	var searched,
 		suppressKeypress = false;
 	
-	jQuery(node)
-	.keydown(function(event){ //fix form submit bug in opera
-		var self = jQuery(this).data('autocomplete');
-		var keyCode = jQuery.ui.keyCode;
+	if(jQuery.browser.opera) {
+		jQuery(node)
+		.keydown(function(event){ //fix form submit bug in opera
+			var self = jQuery(this).data('autocomplete');
+			var keyCode = jQuery.ui.keyCode;
+			suppressKeypress = false;
 
-		if ( self.options.disabled  || !self.menu.element.is( ":visible" ) ) {
-			return;
-		}
-		if ( event.keyCode == keyCode.ENTER || event.keyCode == keyCode.NUMPAD_ENTER) {
-			suppressKeypress = true;
-		}
-	})
-	.keypress(function(event){
-		if ( suppressKeypress ) {
-			suppressKeypress = false;
-			event.preventDefault();
-		}
-	})
-	.autocomplete({
+			if ( self.options.disabled  || !self.menu.element.is( ":visible" ) ) {
+				return;
+			}
+			if ( event.keyCode == keyCode.ENTER || event.keyCode == keyCode.NUMPAD_ENTER) {
+				suppressKeypress = true;
+			}
+		})
+		.keypress(function(event){
+			if ( suppressKeypress ) {
+				suppressKeypress = false;
+				event.preventDefault();
+			}
+		});
+	}
+
+
+	jQuery(node).autocomplete({
 		minLength: 1,
 		source: function(request, response) {
 			var val = this.element.context.value,

Tags: can3p, js, livejournal
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