arma-server-web-admin/public/js/app/views/missions/index.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

2014-07-26 09:01:53 +00:00
define(function (require) {
"use strict";
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Marionette = require('marionette'),
2015-08-15 15:12:50 +00:00
UploadView = require('app/views/missions/upload'),
WorkshopView = require('app/views/missions/workshop'),
2014-07-26 09:01:53 +00:00
ListView = require('app/views/missions/list'),
tpl = require('text!tpl/missions/index.html');
return Marionette.LayoutView.extend({
2014-07-26 09:01:53 +00:00
template: _.template(tpl),
regions: {
2015-08-15 15:12:50 +00:00
uploadView: "#upload",
workshopView: "#workshop",
2014-07-26 09:01:53 +00:00
listView: "#list",
},
2018-08-18 11:04:33 +00:00
events: {
"click #refresh": "refresh",
},
2014-07-26 09:01:53 +00:00
onRender: function() {
2018-08-18 11:04:33 +00:00
this.uploadView.show(new UploadView());
this.workshopView.show(new WorkshopView());
2014-07-26 09:01:53 +00:00
this.listView.show(new ListView({collection: this.options.missions}));
},
2018-08-18 11:04:33 +00:00
refresh: function (event) {
event.preventDefault();
$.ajax({
url: "/api/missions/refresh",
type: 'POST',
success: function (resp) {
},
error: function (resp) {
},
});
},
2014-07-26 09:01:53 +00:00
});
});