Skip to content

Commit

Permalink
Slider widget now respects default value
Browse files Browse the repository at this point in the history
  • Loading branch information
mickrip committed Sep 3, 2015
1 parent 75d1ad7 commit 3cc284f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/core-ui/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ define(['app', 'backbone'], function(app, Backbone) {
},

serialize: function() {

if (this.options.model.isNew() && this.options.schema.has('default_value')) {
this.options.value = this.options.schema.get('default_value');
}

return {
value: this.options.value || '0',
name: this.options.name,
Expand Down Expand Up @@ -89,4 +94,4 @@ define(['app', 'backbone'], function(app, Backbone) {

return Module;

});
});

0 comments on commit 3cc284f

Please sign in to comment.