Module pattern is now implemented via templating

Previously two modules were defined, Layout.js, which is the internal implementation, and main.js, which depended on Layout.js and performed the fill / extract functionality required for a public JavaScript API.

This simplifies the implementation by just exposing a single UMD module by directly including Layout.js within the module wrapper.

Fixes #103
This commit is contained in:
Colin Eberhardt
2015-08-11 17:21:09 +01:00
parent 401f473449
commit 3b406b30c2
3 changed files with 17 additions and 14 deletions

View File

@@ -11,14 +11,15 @@
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
root.computeLayout = factory();
}
}(this, function () {
var layout = require('./Layout.js');
// @@include('./Layout.js')
return function(node) {
node = layout.fillNodes(node);
layout.computeLayout(node);
node = layout.extractNodes(node);
node = computeLayout.fillNodes(node);
computeLayout.computeLayout(node);
node = computeLayout.extractNodes(node);
return node;
};
}));