arma-server-web-admin/public/js/app/views/navigation.js
2017-10-06 00:01:55 +02:00

39 lines
1.1 KiB
JavaScript

define(function (require) {
"use strict";
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Marionette = require('marionette'),
BootstrapModal = require('backbone.bootstrap-modal'),
ServersListView = require('app/views/navigation/servers/list'),
SettingsView = require('app/views/settings'),
tpl = require('text!tpl/navigation.html');
return Marionette.ItemView.extend({
template: _.template(tpl),
events: {
"click #settings": "settings"
},
initialize: function (options) {
this.servers = options.servers;
this.serversListView = new ServersListView({ collection: this.servers })
},
onDomRefresh: function () {
this.serversListView.setElement('#servers-list');
this.serversListView.render();
},
settings: function (event) {
event.preventDefault();
var view = new SettingsView();
new Backbone.BootstrapModal({ content: view, animate: true, cancelText: false }).open();
}
});
});