Skip to content

Commit f7bc2f4

Browse files
committed
Try to fix Issue Gaurav0#8: cannot update datepicker option properties
1 parent c243b81 commit f7bc2f4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

addon/mixins/jqui-widget.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@ export default Ember.Mixin.create({
1717
// Make sure that jQuery UI events trigger methods on this view.
1818
_this._gatherEvents(options);
1919

20-
// Workaround for bug in jQuery UI datepicker
21-
// $.ui.datepicker is not a function
2220
var ui;
2321
var uiType = _this.get('uiType');
22+
23+
// Workaround for bug in jQuery UI datepicker
24+
// $.ui.datepicker is not a function
2425
if (uiType === "datepicker") {
2526
_this.$().datepicker(
26-
$.extend(options, {
27-
onSelect: function() { _this.$().change(); }
28-
})
27+
$.extend(options, {
28+
onSelect: function() { _this.$().change(); }
29+
})
2930
);
30-
ui = _this.$(uiType)['widget'];
31+
ui = {
32+
option: function(key, value) {
33+
_this.$().datepicker('option', key, value);
34+
}
35+
};
3136
} else {
3237

3338
// Create a new instance of the jQuery UI widget based on its `uiType`

0 commit comments

Comments
 (0)