clear button for input type = number, fixes #166
This commit is contained in:
parent
500223ca92
commit
ca14bed8e3
@ -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">',
|
||||
|
Loading…
x
Reference in New Issue
Block a user