X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/a398f2a96740ebe6dd60559d90e74c648e7009af..efe36f4f1b5df351eeb4d40a54c3900cf9a7079b:/fnpjs/layout.js diff --git a/fnpjs/layout.js b/fnpjs/layout.js deleted file mode 100644 index 05252fb..0000000 --- a/fnpjs/layout.js +++ /dev/null @@ -1,37 +0,0 @@ -define(['libs/jquery-1.9.1.min', 'libs/underscore-min'], function($ ,_) { - 'use strict'; - - var Layout = function(template) { - var layout = this; - this.dom = $(_.template(template)()); - this.views = {}; - - this.dom.onShow = function() { - _.values(layout.views).forEach(function(view) { - if(view.onShow) - view.onShow(); - }); - }; - this.dom.onHide = function() { - _.values(layout.views).forEach(function(view) { - if(view.onHide) - view.onHide(); - }); - }; - - }; - - Layout.prototype.setView = function(place, view) { - this.dom.find('[fnpjs-place=' + place + ']').append(view); - this.views[place] = view; - if(this.dom.is(':visible') && view.onShow) { - view.onShow(); - } - }; - - Layout.prototype.getAsView = function() { - return this.dom; - }; - - return {Layout: Layout}; -}); \ No newline at end of file