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