clear button for input type = number, fixes

This commit is contained in:
vitalets 2013-04-02 21:15:01 +04:00
parent 500223ca92
commit ca14bed8e3
2 changed files with 16 additions and 1 deletions

@ -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)

@ -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">',