arma-server-web-admin/public/js/app/views/home.js
2014-02-14 01:16:05 +00:00

29 lines
790 B
JavaScript

define(function (require) {
"use strict";
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Marionette = require('marionette'),
AddServerView = require('app/views/servers/add'),
tpl = require('text!tpl/home.html');
return Marionette.ItemView.extend({
template: _.template(tpl),
events: {
"click #add-server": "addServer"
},
initialize: function (options) {
this.servers = options.servers;
},
addServer: function () {
var view = new AddServerView({servers: this.servers});
new Backbone.BootstrapModal({ content: view, servers: this.servers }).open()
},
});
});