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