diff options
author | Andy Wermke <andy@dev.next-step-software.com> | 2013-04-04 16:10:23 +0200 |
---|---|---|
committer | Andy Wermke <andy@dev.next-step-software.com> | 2013-04-04 16:10:23 +0200 |
commit | 92cd7f34b07e86062f2c024039e3309768b48ce6 (patch) | |
tree | 63b9f39280ebcab80742d9f2b4db6a139c1791e1 /program/js/common.js | |
parent | 029d18f13bcf01aa2f1f08dbdfc6400c081bf7cb (diff) | |
parent | 443b92a7ee19e321b350750240e0fc54ec5be357 (diff) |
Merge branch 'master' of https://github.com/roundcube/roundcubemail
Diffstat (limited to 'program/js/common.js')
-rw-r--r-- | program/js/common.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/program/js/common.js b/program/js/common.js index f9e945c05..f7c0a7536 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -717,13 +717,15 @@ if (bw.ie) { // jQuery plugin to emulate HTML5 placeholder attributes on input elements jQuery.fn.placeholder = function(text) { return this.each(function() { - var elem = $(this); + var active = false, elem = $(this); this.title = text; + // Try HTML5 placeholder attribute first if ('placeholder' in this) { - elem.attr('placeholder', text); // Try HTML5 placeholder attribute first + elem.attr('placeholder', text); } - else { // Fallback to Javascript emulation of placeholder + // Fallback to Javascript emulation of placeholder + else { this._placeholder = text; elem.blur(function(e) { if ($.trim(elem.val()) == "") @@ -740,7 +742,9 @@ jQuery.fn.placeholder = function(text) { elem[(active ? 'addClass' : 'removeClass')]('placeholder').attr('spellcheck', active); }); - if (this != document.activeElement) // Do not blur currently focused element + // Do not blur currently focused element (catch exception: #1489008) + try { active = this == document.activeElement; } catch(e) {} + if (!active) elem.blur(); } }); |