/*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; });