[Jifty-commit] r5328 - in jifty/trunk: share/web/static/js

Jifty commits jifty-commit at lists.jifty.org
Fri Apr 18 13:17:07 EDT 2008


Author: sartak
Date: Fri Apr 18 13:17:05 2008
New Revision: 5328

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/share/web/static/js/jifty.js

Log:
 r54174 at onn:  sartak | 2008-04-18 13:16:16 -0400
 Check that we actually have a placeholder before we fiddle with placeholderText (which can cause a warning on submitting a form with a placeholder field)


Modified: jifty/trunk/share/web/static/js/jifty.js
==============================================================================
--- jifty/trunk/share/web/static/js/jifty.js	(original)
+++ jifty/trunk/share/web/static/js/jifty.js	Fri Apr 18 13:17:05 2008
@@ -1562,11 +1562,11 @@
      // browser screwed up and didn't clear our placeholder. Opera on Mac with
      // VirtueDesktops does this some times, and I lose data.
      // These are normalized because sometimes one has \r\n and the other has \n
-     elt.value = elt.value.replace(/\r/g, '');
-     elt.placeholderText = elt.placeholderText.replace(/\r/g, '');
-
-     if(Jifty.Placeholder.hasPlaceholder(elt) && elt.value == elt.placeholderText) {
-       jQuery(elt).removeClass('placeholder').val('');
+     if (Jifty.Placeholder.hasPlaceholder(elt)) {
+        elt.value = elt.value.replace(/\r/g, '');
+        elt.placeholderText = elt.placeholderText.replace(/\r/g, '');
+        if (elt.value == elt.placeholderText)
+            jQuery(elt).removeClass('placeholder').val('');
      }
   }
 


More information about the Jifty-commit mailing list