Fixed: Error messages not being shown in the UI or being shown in the wrong place

This commit is contained in:
Mark McDowall
2014-06-04 08:38:26 -07:00
parent 9916479f02
commit 545bc756f2
13 changed files with 66 additions and 34 deletions
@@ -1,5 +1,6 @@
<div id="x-download-clients-region"></div>
<div class="form-horizontal">
<div id="x-download-handling-region"></div>
<div id="x-dronefactory-region"></div>
</div>
@@ -26,7 +26,7 @@ define([
this.model.set({
id : undefined,
name : this.model.get('implementation'),
name : undefined,
enable : true
});
@@ -22,13 +22,18 @@ define([
'click .x-save-and-add': '_saveAndAdd',
'click .x-delete' : '_delete',
'click .x-back' : '_back',
'click .x-test' : '_test'
'click .x-close' : '_close',
'click .x-test' : '_test'
},
initialize: function (options) {
this.targetCollection = options.targetCollection;
},
onBeforeClose: function () {
window.alert('closing down!');
},
_save: function () {
var self = this;
var promise = this.model.save();
@@ -67,6 +72,19 @@ define([
require('Settings/Indexers/Add/IndexerSchemaModal').open(this.targetCollection);
},
_close: function () {
if (this.model.isNew()) {
this.model.destroy();
}
else {
this.model.fetch();
}
vent.trigger(vent.Commands.CloseModalCommand);
},
_test: function () {
var testCommand = 'test{0}'.format(this.model.get('implementation'));
var properties = {};
@@ -1,7 +1,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<button type="button" class="close x-close" aria-hidden="true">&times;</button>
{{#if id}}
<h3>Edit - {{implementation}}</h3>
{{else}}
@@ -48,7 +48,7 @@
<!-- Testing is currently not yet supported for indexers, but leaving the infrastructure for later -->
<!-- <button class="btn x-test">test <i class="x-test-icon icon-nd-test"/></button> -->
<button class="btn" data-dismiss="modal">cancel</button>
<button class="btn x-close">cancel</button>
<div class="btn-group">
<button class="btn btn-primary x-save">save</button>
@@ -2,5 +2,5 @@
<div id="episode-naming"></div>
<div id="sorting"></div>
<div id="file-management"></div>
<div id="permissions"></div>
{{#if_mono}}<div id="permissions"></div>{{/if_mono}}
</div>
@@ -1,5 +1,4 @@
{{#if_mono}}
<fieldset class="advanced-setting">
<fieldset class="advanced-setting">
<legend>Permissions</legend>
<div class="form-group">
@@ -73,4 +72,3 @@
</div>
</div>
</fieldset>
{{/if_mono}}