mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Do not reload until upload is complete
This commit is contained in:
parent
c125645823
commit
269cb62ec1
@ -1,7 +1,7 @@
|
||||
define(function (require) {
|
||||
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var $ = require('jquery'),
|
||||
_ = require('underscore'),
|
||||
Backbone = require('backbone'),
|
||||
@ -9,32 +9,32 @@ define(function (require) {
|
||||
FormView = require('marionette-formview'),
|
||||
IframeTransport = require('jquery.iframe-transport'),
|
||||
Mission = require('app/models/mission'),
|
||||
tpl = require('text!tpl/missions/form.html');
|
||||
|
||||
tpl = require('text!tpl/missions/form.html');
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template: _.template(tpl),
|
||||
|
||||
|
||||
initialize: function (options) {
|
||||
this.missions = options.missions;
|
||||
this.model = new Mission();
|
||||
this.bind("ok", this.submit);
|
||||
},
|
||||
|
||||
|
||||
submit: function (modal) {
|
||||
var self = this;
|
||||
|
||||
|
||||
modal.preventClose();
|
||||
|
||||
|
||||
var $form = $("form");
|
||||
$.ajax("/api/missions", {
|
||||
files: $form.find(":file"),
|
||||
iframe: true
|
||||
}).complete(function(data) {
|
||||
modal.close();
|
||||
self.missions.fetch();
|
||||
Backbone.history.navigate('#missions', true)
|
||||
self.missions.fetch({success : function () {
|
||||
Backbone.history.navigate('#missions', true);
|
||||
}});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user