aboutsummaryrefslogtreecommitdiff
path: root/js/document/models/html.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/models/html.js')
-rwxr-xr-xjs/document/models/html.js59
1 files changed, 23 insertions, 36 deletions
diff --git a/js/document/models/html.js b/js/document/models/html.js
index fd42d4de..7064c6e3 100755
--- a/js/document/models/html.js
+++ b/js/document/models/html.js
@@ -18,9 +18,14 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, {
18 value: false 18 value: false
19 }, 19 },
20 //////////////////////////////////////////////////////////////////// 20 ////////////////////////////////////////////////////////////////////
21 // 21 //Called by the document immidiately after the model is created
22 selection: { 22 init: {
23 value: [] 23 value:function() {
24 //Creating instance of the webGL helper for this model
25 this.webGlHelper = webGlDocumentHelper.create();
26 //
27 this.libs = {montage: false, canvas: false, montageId: null, canvasId: null};
28 }
24 }, 29 },
25 //////////////////////////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////////////
26 // 31 //
@@ -37,57 +42,39 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, {
37 scrollLeft: { 42 scrollLeft: {
38 value: null 43 value: null
39 }, 44 },
40 45 ////////////////////////////////////////////////////////////////////
46 //
41 scrollTop: { 47 scrollTop: {
42 value: null 48 value: null
43 }, 49 },
44 50 ////////////////////////////////////////////////////////////////////
51 //
45 userContentLeft: { 52 userContentLeft: {
46 value: null 53 value: null
47 }, 54 },
48 55 ////////////////////////////////////////////////////////////////////
56 //
49 userContentTop: { 57 userContentTop: {
50 value: null 58 value: null
51 }, 59 },
52 //////////////////////////////////////////////////////////////////// 60 ////////////////////////////////////////////////////////////////////
53 // 61 //TODO: Convert to bindings
62 documentRoot: {
63 get: function() {return this.views.design._documentRoot;},
64 set: function(value) {this.views.design._documentRoot = value;}
65 },
66 ////////////////////////////////////////////////////////////////////
67 //TODO: Convert to bindings
54 baseHref: { 68 baseHref: {
55 value: null 69 get: function() {return this.views.design._baseHref;},
70 set: function(value) {this.views.design._baseHref = value;}
56 }, 71 },
57 //////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////
58 // 73 //
59 webGlHelper: { 74 webGlHelper: {
60 value: webGlDocumentHelper
61 },
62 ////////////////////////////////////////////////////////////////////
63 //
64 userComponents: {
65 value: {}
66 },
67 ////////////////////////////////////////////////////////////////////
68 //
69 documentRoot: {
70 value: null 75 value: null
71 }, 76 },
72 ////////////////////////////////////////////////////////////////////
73 //Add a reference to a component instance to the userComponents hash using the element UUID
74 setComponentInstance: {
75 value: function(instance, el) {
76 this.userComponents[el.uuid] = instance;
77 }
78 },
79 //////////////////////////////////////////////////////////////////// 77 ////////////////////////////////////////////////////////////////////
80 //Returns the component instance obj from the element
81 getComponentFromElement: {
82 value: function(el) {
83 if(el) {
84 if(el.uuid) return this.userComponents[el.uuid];
85 } else {
86 return null;
87 }
88 }
89 }
90 ////////////////////////////////////////////////////////////////////
91 //////////////////////////////////////////////////////////////////// 78 ////////////////////////////////////////////////////////////////////
92}); 79});
93//////////////////////////////////////////////////////////////////////// 80////////////////////////////////////////////////////////////////////////