diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-15 21:55:22 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-15 21:55:22 +0000 |
| commit | 7a09809dd8061257e5bc35bd879b27e3ecb288f7 (patch) | |
| tree | 6e8ca99b82359ef503b4647e6c9cfbbfb1c89538 /roundcubemail/program/js/app.js | |
| parent | 653a2254dcfba00926b7fa3966a0ec4ce653f520 (diff) | |
Improve input field placeholders: use native attributes if supported, encapsulate in jquery plugin
git-svn-id: https://svn.roundcube.net/trunk@6016 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index b2cb1c0c1..94e48a823 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -4505,9 +4505,7 @@ function rcube_webmail() if (!elem) elem = $('.ff_' + col); - elem.focus(function(){ ref.focus_textfield(this); }) - .blur(function(){ ref.blur_textfield(this); }) - .each(function(){ this._placeholder = this.title = (ref.env.coltypes[col].label || ''); ref.blur_textfield(this); }); + elem.placeholder(ref.env.coltypes[col].label); }; this.insert_edit_field = function(col, section, menu) @@ -5424,22 +5422,6 @@ function rcube_webmail() } }; - this.focus_textfield = function(elem) - { - elem._hasfocus = true; - var $elem = $(elem); - if ($elem.hasClass('placeholder') || $elem.val() == elem._placeholder) - $elem.val('').removeClass('placeholder').attr('spellcheck', true); - }; - - this.blur_textfield = function(elem) - { - elem._hasfocus = false; - var $elem = $(elem); - if (elem._placeholder && (!$elem.val() || $elem.val() == elem._placeholder)) - $elem.addClass('placeholder').attr('spellcheck', false).val(elem._placeholder); - }; - // write to the document/window title this.set_pagetitle = function(title) { |
