<div class="js-modal-messages"></div>
<div class="modal-field">
<label for="copy-profile-name">{{t 'quality_profiles.copy_new_name'}}<em class="mandatory">*</em></label>
- <input id="copy-profile-name" name="name" type="text" size="50" maxlength="100">
+ <input id="copy-profile-name" name="name" type="text" size="50" maxlength="100" required>
</div>
</div>
<div class="modal-foot">
<div class="js-modal-messages"></div>
<div class="modal-field">
<label for="rename-profile-name">{{t 'quality_profiles.new_name'}} <em class="mandatory">*</em></label>
- <input id="rename-profile-name" name="name" type="text" size="50" maxlength="100" value="{{name}}">
+ <input id="rename-profile-name" name="name" type="text" size="50" maxlength="100" value="{{name}}" required>
</div>
</div>
<div class="modal-foot">
<div class="js-modal-messages"></div>
<div class="modal-field">
<label for="restore-profile-backup">{{t 'backup'}}<em class="mandatory">*</em></label>
- <input type="file" id="restore-profile-backup" name="backup">
+ <input type="file" id="restore-profile-backup" name="backup" required>
</div>
</div>
<div class="modal-foot">
});
}
this.ui.messagesContainer.scrollParent().scrollTop(0);
+ },
+
+ disableForm: function () {
+ var form = this.$('form');
+ this.disabledFields = form.find(':input:not(:disabled)');
+ this.disabledFields.prop('disabled', true);
+ },
+
+ enableForm: function () {
+ if (this.disabledFields != null) {
+ this.disabledFields.prop('disabled', false);
+ }
}
});
onFormSubmit: function () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest();
},
that.close();
}).fail(function (jqXHR) {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
+ that.enableForm();
});
},
onFormSubmit: function () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest();
},
that.addProfile(r);
that.close();
}).fail(function (jqXHR) {
+ that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
},
onFormSubmit: function (e) {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest(e);
},
uploader({ form: $(e.currentTarget) }).done(function (r) {
if (_.isArray(r.errors) || _.isArray(r.warnings)) {
that.showErrors(r.errors, r.warnings);
+ that.enableForm();
} else {
that.addProfile(r.profile);
that.close();
onFormSubmit: function () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest();
},
that.model.trigger('destroy', that.model, that.model.collection);
}).fail(function (jqXHR) {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
+ that.enableForm();
});
}
});
onFormSubmit: function () {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest();
},
that.close();
}).fail(function (jqXHR) {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
+ that.enableForm();
});
}
});
onFormSubmit: function (e) {
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
this.sendRequest();
},
that.close();
}).fail(function (jqXHR) {
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
+ that.enableForm();
});
},
onFormSubmit: function (e) {
var that = this;
ModalFormView.prototype.onFormSubmit.apply(this, arguments);
+ this.disableForm();
uploader({ form: $(e.currentTarget) }).done(function (r) {
if (_.isArray(r.errors) || _.isArray(r.warnings)) {
that.showErrors(r.errors, r.warnings);
+ that.enableForm();
} else {
that.collection.fetch().done(function () {
var profile = that.collection.findWhere({ key: r.profile.key });