summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mixins
diff options
context:
space:
mode:
authorJefferson Stachelski <jefferson.stachelski@gmail.com>2015-07-28 14:38:25 -0300
committerJefferson Stachelski <jefferson.stachelski@gmail.com>2015-07-28 14:38:25 -0300
commit6cba38db104dbbedc7c0f29b22c242ac43a75bcd (patch)
treebd7802ae7b17e818bcaa22c2e3ee49d8cefac24b /web-ui/app/js/mixins
parent1d77f71ae03087c2264de21cbc3ccf17612a9d78 (diff)
parentb228de6c5ef8cbf772f7d05d9e851acc96fb58a0 (diff)
Merge pull request #407 from schaffer/floatlabel_for_compose
Trying to fix issue #384
Diffstat (limited to 'web-ui/app/js/mixins')
-rw-r--r--web-ui/app/js/mixins/with_mail_edit_base.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js
index 848fe026..3a7b14b5 100644
--- a/web-ui/app/js/mixins/with_mail_edit_base.js
+++ b/web-ui/app/js/mixins/with_mail_edit_base.js
@@ -203,6 +203,22 @@ define(
this.trigger(document, events.ui.userAlerts.displayMessage, { message: 'Your message was sent!' });
};
+ this.enableFloatlabel = function(element) {
+ var showClass = 'showfloatlabel';
+ $(element).bind('checkval', function() {
+ var label = $(this).prev('label');
+ if (this.value !== '') {
+ label.addClass(showClass);
+ $(this).addClass(showClass);
+ } else {
+ label.removeClass(showClass);
+ $(this).removeClass(showClass);
+ }
+ }).on('keyup', function() {
+ $(this).trigger('checkval');
+ }).trigger('checkval');
+ };
+
this.after('initialize', function () {
this.on(document, events.dispatchers.rightPane.clear, this.teardown);
this.on(document, events.ui.recipients.updated, this.recipientsUpdated);