X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b7266f76b76a0a67000144d2780a8f64967fafb4..bb42027c8fd9ed17234381d3c366c387a20592f0:/fnpjs/layout.js diff --git a/fnpjs/layout.js b/fnpjs/layout.js index 99b2e58..d5fa098 100644 --- a/fnpjs/layout.js +++ b/fnpjs/layout.js @@ -12,6 +12,12 @@ define(['libs/jquery-1.9.1.min', 'libs/underscore-min'], function($ ,_) { view.onShow(); }); }; + this.dom.onHide = function() { + _.values(layout.views).forEach(function(view) { + if(view.onHide) + view.onHide(); + }); + }; }; @@ -24,7 +30,7 @@ define(['libs/jquery-1.9.1.min', 'libs/underscore-min'], function($ ,_) { }; Layout.prototype.getAsView = function() { - return this.dom + return this.dom; }; return {Layout: Layout};