arma-server-web-admin/public/js/app/views/navigation.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

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