mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
39 lines
1.1 KiB
JavaScript
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/forms/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 }).open()
|
|
}
|
|
});
|
|
|
|
});
|