arma-server-web-admin/public/js/app/views/navigation.js
Björn Dahlgren c58ec6f308 Update frontend dependencies
Backbone to 1.3.3
Marionette to 2.4.7
Underscore to 1.8.3

Fixes collection sorting when new items are added
2018-08-18 02:53:27 +02:00

40 lines
1.2 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.settings = options.settings;
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({ model: this.settings });
new Backbone.BootstrapModal({ content: view, animate: true, cancelText: false }).open();
}
});
});