assets/js/romo/datepicker.js in romo-0.15.7 vs assets/js/romo/datepicker.js in romo-0.15.8
- old
+ new
@@ -9,18 +9,19 @@
this.defaultFormat = 'yyyy-mm-dd'
this.monthNames = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
]
- this.defaultPrevClass = undefined;
- this.defaultNextClass = undefined;
- this.defaultIndicatorClass = undefined;
- this.itemSelector = 'TD.romo-datepicker-day:not(.disabled)';
- this.calTable = $();
- this.date = undefined;
- this.today = new Date;
- this.prevValue = undefined;
+ this.defaultPrevClass = undefined;
+ this.defaultNextClass = undefined;
+ this.defaultIndicatorClass = undefined;
+ this.defaultIndicatorWidthPx = 0;
+ this.itemSelector = 'TD.romo-datepicker-day:not(.disabled)';
+ this.calTable = $();
+ this.date = undefined;
+ this.today = new Date;
+ this.prevValue = undefined;
this.doInit();
this.doBindElem();
this.doSetFormat();
this.doSetDate(this.elem.val());
@@ -65,10 +66,16 @@
}
if (this.elem.css('display') === 'none') {
this._hide(this.indicatorElem);
}
this.indicatorElem.on('click', $.proxy(this.onIndicatorClick, this));
- this.elem.css({'padding-right': '22px'});
+
+ var indicatorWidthPx = this.elem.data('romo-datepicker-indicator-width-px') || this.defaultIndicatorWidthPx;
+ // left-side spacing
+ // + indicator width
+ // + right-side spacing
+ var indicatorPaddingPx = 4 + indicatorWidthPx + 4;
+ this.elem.css({'padding-right': indicatorPaddingPx + 'px'});
this.elem.after(this.indicatorElem);
}
this.prevValue = this.elem.val();
this.elem.on('change', $.proxy(function(e) {