2014-02-09 03:19:48 +00:00
|
|
|
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 () {
|
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()
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|