Commit 3229aaf5 by cahrens

Call polyfill at right time.

parent aa41aed9
......@@ -29,9 +29,6 @@ class CMS.Views.ModuleEdit extends Backbone.View
model: new Backbone.Model(metadataEditor.data('metadata'))
});
#Manually runs polyfill for input number types to correct for Firefox non-support
#numberPolyfill()
# Need to update set "active" class on data editor if there is one.
# If we are only showing settings, hide the data editor controls and update settings accordingly.
if @hasDataEditor()
......
......@@ -100,12 +100,15 @@ CMS.Views.Metadata.AbstractEditor = Backbone.View.extend({
showClearButton: function() {
if (!this.$el.hasClass('is-set')) {
this.$el.addClass('is-set');
// TODO: can we use toggleclass?
this.$el.find('.setting-clear').removeClass('inactive');
this.$el.find('.setting-clear').addClass('active');
this.getClearButton().removeClass('inactive');
this.getClearButton().addClass('active');
}
},
getClearButton: function () {
return this.$el.find('.setting-clear');
},
render: function () {
if (!this.template) return;
......@@ -116,9 +119,8 @@ CMS.Views.Metadata.AbstractEditor = Backbone.View.extend({
}
else {
this.$el.removeClass('is-set');
// TODO: can we use toggleclass?
this.$el.find('.setting-clear').addClass('inactive');
this.$el.find('.setting-clear').removeClass('active');
this.getClearButton().addClass('inactive');
this.getClearButton().removeClass('active');
}
}
});
......@@ -154,7 +156,7 @@ CMS.Views.Metadata.Number = CMS.Views.Metadata.AbstractEditor.extend({
render: function () {
CMS.Views.Metadata.AbstractEditor.prototype.render.apply(this);
if (!this.inputAttributesSet) {
if (!this.initialized) {
var min = "min";
var max = "max";
var step = "step";
......@@ -175,7 +177,11 @@ CMS.Views.Metadata.Number = CMS.Views.Metadata.AbstractEditor.extend({
if (stepValue !== undefined) {
this.$el.find('input').attr(step, stepValue);
}
this.inputAttributesSet = true;
// Manually runs polyfill for input number types to correct for Firefox non-support
this.$el.find('.setting-input-number').inputNumber();
this.initialized = true;
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment