mirror of
https://github.com/frappe/air-datepicker.git
synced 2026-01-14 11:01:22 +08:00
add resize event, modify readme
This commit is contained in:
parent
810bc399be
commit
c9659eb5cf
@ -13,7 +13,7 @@ $('.my-datepicker').datepicker([options])
|
||||
```
|
||||
|
||||
## Demo and docs
|
||||
[Demo]()
|
||||
[Demo](http://t1m0n.name/air-datepicker/docs/)
|
||||
|
||||
|
||||
|
||||
|
||||
9
dist/js/datepicker.js
vendored
9
dist/js/datepicker.js
vendored
@ -136,6 +136,7 @@ var Datepicker;
|
||||
this.$el.on('input', this._onInput.bind(this));
|
||||
this.$datepicker.on('mousedown', this._onMouseDownDatepicker.bind(this));
|
||||
this.$datepicker.on('mouseup', this._onMouseUpDatepicker.bind(this));
|
||||
$(window).on('resize', this._onResize.bind(this))
|
||||
},
|
||||
|
||||
isWeekend: function (day) {
|
||||
@ -480,6 +481,8 @@ var Datepicker;
|
||||
},
|
||||
|
||||
setPosition: function (position) {
|
||||
position = position || this.opts.position;
|
||||
|
||||
var dims = this._getDimensions(this.$el),
|
||||
selfDims = this._getDimensions(this.$datepicker),
|
||||
pos = position.split(' '),
|
||||
@ -578,6 +581,12 @@ var Datepicker;
|
||||
}
|
||||
},
|
||||
|
||||
_onResize: function () {
|
||||
if (this.visible) {
|
||||
this.setPosition();
|
||||
}
|
||||
},
|
||||
|
||||
get parsedDate() {
|
||||
return Datepicker.getParsedDate(this.date);
|
||||
},
|
||||
|
||||
2
dist/js/datepicker.min.js
vendored
2
dist/js/datepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -136,6 +136,7 @@ var Datepicker;
|
||||
this.$el.on('input', this._onInput.bind(this));
|
||||
this.$datepicker.on('mousedown', this._onMouseDownDatepicker.bind(this));
|
||||
this.$datepicker.on('mouseup', this._onMouseUpDatepicker.bind(this));
|
||||
$(window).on('resize', this._onResize.bind(this))
|
||||
},
|
||||
|
||||
isWeekend: function (day) {
|
||||
@ -480,6 +481,8 @@ var Datepicker;
|
||||
},
|
||||
|
||||
setPosition: function (position) {
|
||||
position = position || this.opts.position;
|
||||
|
||||
var dims = this._getDimensions(this.$el),
|
||||
selfDims = this._getDimensions(this.$datepicker),
|
||||
pos = position.split(' '),
|
||||
@ -578,6 +581,12 @@ var Datepicker;
|
||||
}
|
||||
},
|
||||
|
||||
_onResize: function () {
|
||||
if (this.visible) {
|
||||
this.setPosition();
|
||||
}
|
||||
},
|
||||
|
||||
get parsedDate() {
|
||||
return Datepicker.getParsedDate(this.date);
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user