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

[livejournal] r18056: LJSUP-7733: Cannot Recommend new post.

Committer: pkornilov
LJSUP-7733: Cannot Recommend new post.
U   trunk/htdocs/js/jquery_fn.js
Modified: trunk/htdocs/js/jquery_fn.js
===================================================================
--- trunk/htdocs/js/jquery_fn.js	2011-01-19 09:03:49 UTC (rev 18055)
+++ trunk/htdocs/js/jquery_fn.js	2011-01-19 09:20:17 UTC (rev 18056)
@@ -84,17 +84,21 @@
 			return this.each(function() {
 				if (this.getAttribute("placeholder")) {
 					var $this = jQuery(this);
+					
+					if (!$this.data('jQuery-has-placeholder')) {
+						$this.focus(check_focus).blur(check_blur);
 
-					$this.focus(check_focus).blur(check_blur);
+						jQuery(this.form)
+							.submit(function() {
+								$this.hasClass("placeholder") && $this.removeClass("placeholder").val("");
+							});
+					}
 
-					jQuery(this.form)
-						.submit(function() {
-							$this.hasClass("placeholder") && $this.removeClass("placeholder").val("");
-						});
-
 					this.value === this.getAttribute("placeholder") || !this.value
 						? $this.val(this.getAttribute("placeholder")).addClass("placeholder")
 						: $this.removeClass("placeholder");
+
+					$this.data('jQuery-has-placeholder', true)
 				}
 			});
 		}

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