1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.3 KiB

/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
define([
"underscore"
, "jquery"
, "backbone"
, "views/list"
, "views/client"
]
, function (
_
, $
, Backbone
, ListView
, ClientView
) {
"use strict";
var Main = Backbone.View.extend({
el: $("div#wrapperMain")
, children: {}
, initialize: function (playlistCollection) {
//this.setView("playlist", new ListView(playlistCollection));
Main.__super__.initialize.apply(this, arguments);
}
, setView: function (name, view) {
console.debug("Set view: "+ name);
this.children[name] = view;
}
, getView: function (name) {
return this.children[name];
}
, showView: function (name) {
console.debug("Show view: "+ name);
if (this.children[name] && this.children[name].$el) {
this.children[name].$el.show();
this.$el.append(this.children[name].$el);
}
}
, hideView: function (name) {
console.debug("Hide view: "+ name);
if (this.children[name] && this.children[name].$el) {
this.children[name].$el.hide();
this.$el.remove(this.children[name].$el);
}
}
, toggleView: function (name) {
if (this.children[name] && this.children[name].$el) {
this.children[name].$el.toggle();
}
}
});
return Main;
});