summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-03-15 21:55:22 +0000
committerthomascube <thomas@roundcube.net>2012-03-15 21:55:22 +0000
commit9e2c949d86bb56afa37a4c952f8e8930b7c9958e (patch)
tree451ac9fef4e3f9e64de3a4ab06b0887a960d832b /program/js/app.js
parentb9ce92d883b30172b6185ac4dd1a922b3c414f0f (diff)
Improve input field placeholders: use native attributes if supported, encapsulate in jquery plugin
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js20
1 files changed, 1 insertions, 19 deletions
diff --git a/program/js/app.js b/program/js/app.js
index b2cb1c0c1..94e48a823 100644
--- a/program/js/app.js
+++ b/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)
{