elm/libraries/Native/Graphics/Collage.js
Evan Czaplicki b40f2958d4 New convention for storing module values, fixes bug
Before it was not possible to add values to anything except leafs of
the namespace structure.
2013-09-30 01:32:27 -07:00

23 lines
No EOL
710 B
JavaScript

Elm.Native.Graphics.Collage = {};
Elm.Native.Graphics.Collage.make = function(elm) {
elm.Native = elm.Native || {};
elm.Native.Graphics = elm.Native.Graphics || {};
elm.Native.Graphics.Collage = elm.Native.Graphics.Collage || {};
if (elm.Native.Graphics.Collage.values) return elm.Native.Graphics.Collage.values;
var newElement = Elm.Graphics.Element.make(elm).newElement;
var C = ElmRuntime.use(ElmRuntime.Render.Collage);
function collage(w,h,forms) {
return A3(newElement, w, h, {
ctor: 'Custom',
type: 'Collage',
render: C.render,
update: C.update,
model: {w:w, h:h, forms:forms}
});
}
return elm.Native.Graphics.Collage.values = { collage:F3(collage) };
};