wip: Experimenting with new approach - dividing visualEditor module
[fnpeditor.git] / fnpjs / layout.js
diff --git a/fnpjs/layout.js b/fnpjs/layout.js
new file mode 100644 (file)
index 0000000..a7c27fe
--- /dev/null
@@ -0,0 +1,18 @@
+define(['libs/jquery-1.9.1.min', 'libs/underscore-min'], function($ ,_) {\r
+    'use strict';\r
+      \r
+    var Layout = function(template) {\r
+        this.dom = $(_.template(template)());\r
+        \r
+    };\r
+    \r
+    Layout.prototype.setView = function(place, view) {\r
+        this.dom.find('[fnpjs-place=' + place + ']').append(view);\r
+    };\r
+    \r
+    Layout.prototype.getAsView = function() {\r
+        return this.dom\r
+    };\r
+    \r
+    return {Layout: Layout};\r
+});
\ No newline at end of file