diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8199f79..5ecb1d9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ X-editable changelog Version 1.4.4 wip ---------------------------- +[bug #166] clear button forinput type = number (vitalets) [bug] checklist don't show checked for single value (vitalets) [enh #188] added bootstrap datetime (adeg, vitalets) [bug] editable-poshytip on inline mode tries to write in $.Poshytip (vitalets) diff --git a/src/inputs/html5types.js b/src/inputs/html5types.js index 97cf94c..139ca41 100644 --- a/src/inputs/html5types.js +++ b/src/inputs/html5types.js @@ -123,7 +123,21 @@ Number this.setAttr('min'); this.setAttr('max'); this.setAttr('step'); - } + }, + postrender: function() { + if(this.$clear) { + //can position clear button only here, when form is shown and height can be calculated + var h = this.$input.outerHeight() || 20, + delta = (h - this.$clear.height()) / 2; + + //workaround for plain-popup + if(delta < 3) { + delta = 3; + } + //add 12px to offset right for up/down arrows + this.$clear.css({bottom: delta, right: delta + 12}); + } + } }); NumberInput.defaults = $.extend({}, $.fn.editabletypes.text.defaults, { tpl: '<input type="number">',