From 22581247661fdf7e3b6d9e209fac5824db9b5a03 Mon Sep 17 00:00:00 2001 From: vitalets <noginsk@rambler.ru> Date: Mon, 7 Jan 2013 14:02:16 +0400 Subject: [PATCH] text: move right padding for clear to render, otherwise popup position wrong --- src/inputs/text.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/inputs/text.js b/src/inputs/text.js index 62db4ab..ef0d4a2 100644 --- a/src/inputs/text.js +++ b/src/inputs/text.js @@ -43,8 +43,11 @@ $(function(){ renderClear: function() { if (this.options.clear) { this.$clear = $('<span class="editable-clear-x"></span>'); - this.$input.after(this.$clear).parent().css('position', 'relative'); - this.$input.keyup($.proxy(this.toggleClear, this)); + this.$input.after(this.$clear) + .css('padding-right', 25) + .keyup($.proxy(this.toggleClear, this)) + .parent().css('position', 'relative'); + this.$clear.click($.proxy(function(){ this.$clear.hide(); this.$input.val('').focus(); @@ -64,7 +67,6 @@ $(function(){ } this.$clear.css({top: delta, right: delta}); - this.$input.css('padding-right', this.$clear.width() + 2*delta - 3); } },