arma-server-web-admin/public/js/app/views/servers/empty.js

30 lines
780 B
JavaScript
Raw Normal View History

2014-02-09 03:19:48 +00:00
define(function (require) {
2014-04-13 17:10:40 +00:00
2014-02-09 03:19:48 +00:00
"use strict";
2014-04-13 17:10:40 +00:00
2014-02-09 03:19:48 +00:00
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Marionette = require('marionette'),
AddServerView = require('app/views/servers/add'),
2014-04-13 17:10:40 +00:00
tpl = require('text!tpl/servers/empty.html');
2014-02-09 03:19:48 +00:00
return Marionette.ItemView.extend({
template: _.template(tpl),
2014-04-13 17:10:40 +00:00
2014-02-09 03:19:48 +00:00
events: {
"click #add-server": "addServer"
},
2014-04-13 17:10:40 +00:00
2014-02-09 03:19:48 +00:00
initialize: function (options) {
this.servers = options.servers;
},
2014-04-13 17:10:40 +00:00
2014-02-09 03:19:48 +00:00
addServer: function () {
2014-02-14 01:16:05 +00:00
var view = new AddServerView({servers: this.servers});
2014-02-09 03:19:48 +00:00
new Backbone.BootstrapModal({ content: view, servers: this.servers }).open()
},
});
2014-04-13 17:10:40 +00:00
});