[Jifty-commit] jifty branch, master, updated. 1.10518-37-ge9b1b81
Jifty commits
jifty-commit at lists.jifty.org
Tue Jul 12 12:53:03 EDT 2011
The branch, master has been updated
via e9b1b8145f96e66202dfd51527d34393f1c55d10 (commit)
via e3acca7274f619bed75dae22a7fff5e28068ad7e (commit)
from 896d9d86fe0f4b357b1fd556d8987687e3a6b60f (commit)
Summary of changes:
share/web/static/js/jifty.js | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit e3acca7274f619bed75dae22a7fff5e28068ad7e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Tue Jul 12 12:37:27 2011 -0400
Only reinstate a placeholder if the input had one before we cleared it
Otherwise empty inputs are blindly marked as having placeholders when
they never did. This causes some hilarious behaviour when
ajax validation/canonicalization runs and leads to javascript errors.
diff --git a/share/web/static/js/jifty.js b/share/web/static/js/jifty.js
index 0f7d0dd..aa069a6 100644
--- a/share/web/static/js/jifty.js
+++ b/share/web/static/js/jifty.js
@@ -175,9 +175,13 @@ Action.prototype = {
var serialized = new Array;
jQuery.each(fields, function() {
+ var hadPlaceholder = Jifty.Placeholder.hasPlaceholder(this);
Jifty.Placeholder.clearPlaceholder(this);
+
serialized.push( jQuery(this).serialize() )
- Jifty.Placeholder.replacePlaceholder(this);
+
+ if (hadPlaceholder)
+ Jifty.Placeholder.replacePlaceholder(this);
});
return serialized.join('&');
commit e9b1b8145f96e66202dfd51527d34393f1c55d10
Author: Thomas Sibley <trs at bestpractical.com>
Date: Tue Jul 12 12:44:23 2011 -0400
Try to be less brittle if we find ourselves without a placeholderText attribute
Behaviour will still be wonky, but javascript errors won't abound.
diff --git a/share/web/static/js/jifty.js b/share/web/static/js/jifty.js
index aa069a6..45f6129 100644
--- a/share/web/static/js/jifty.js
+++ b/share/web/static/js/jifty.js
@@ -1909,7 +1909,7 @@ jQuery.extend(Jifty.Placeholder, {
// These are normalized because sometimes one has \r\n and the other has \n
if (Jifty.Placeholder.hasPlaceholder(elt)) {
var value = elt.value.replace(/\r/g, '');
- var placeholder = elt.placeholderText.replace(/\r/g, '');
+ var placeholder = (elt.placeholderText || '').replace(/\r/g, '');
if (value == placeholder)
jQuery(elt).removeClass('placeholder').val('');
}
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list