1 define(['libs/jquery', 'libs/underscore'], function($ ,_) {
4 var Layout = function(template) {
6 this.dom = $(_.template(template)());
9 this.dom.onShow = function() {
10 _.values(layout.views).forEach(function(view) {
15 this.dom.onHide = function() {
16 _.values(layout.views).forEach(function(view) {
24 Layout.prototype.setView = function(place, view) {
25 this.dom.find('[fnpjs-place=' + place + ']').append(view);
26 this.views[place] = view;
27 if(this.dom.is(':visible') && view.onShow) {
32 Layout.prototype.getAsView = function() {
36 return {Layout: Layout};