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

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