| | |
| | | if (!this._events[evt]) |
| | | this._events[evt] = []; |
| | | |
| | | var e = {func:func, obj:obj ? obj : window}; |
| | | this._events[evt][this._events[evt].length] = e; |
| | | this._events[evt].push({func:func, obj:obj ? obj : window}); |
| | | }, |
| | | |
| | | /** |
| | |
| | | // 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 |
| | |
| | | elem[(active ? 'addClass' : 'removeClass')]('placeholder').attr('spellcheck', active); |
| | | }); |
| | | |
| | | // Do not blur currently focused element |
| | | // Catch "unspecified error" in IE9 (#1489008) |
| | | try { |
| | | if (this != document.activeElement) |
| | | elem.blur(); |
| | | } |
| | | catch(e) {} |
| | | // Do not blur currently focused element (catch exception: #1489008) |
| | | try { active = this == document.activeElement; } catch(e) {} |
| | | if (!active) |
| | | elem.blur(); |
| | | } |
| | | }); |
| | | }; |