aboutsummaryrefslogtreecommitdiff
path: root/js/document/templates
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-05 21:40:44 -0700
committerValerio Virgillito2012-06-05 21:40:44 -0700
commite28eb9158a50d7e6d97dbc68066e591ac600c241 (patch)
tree1615affe62374ae67eaecb8b1966a2f464559dfa /js/document/templates
parentd7555c35b357e28a1e1ccc1c4edc4fe04d2b139a (diff)
downloadninja-e28eb9158a50d7e6d97dbc68066e591ac600c241.tar.gz
removing all model creators.
The elementModel is now a getter that will create a new model when needed. Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/document/templates')
-rwxr-xr-xjs/document/templates/banner/index.html24
-rwxr-xr-xjs/document/templates/html/index.html27
2 files changed, 44 insertions, 7 deletions
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index f1ee3d98..08a998e5 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -74,9 +74,27 @@
74 </style> 74 </style>
75 75
76 <script type="text/javascript" data-ninja-template="true"> 76 <script type="text/javascript" data-ninja-template="true">
77 function getElement(x,y) { 77
78 return document.elementFromPoint(x,y); 78 function getElement(x,y) {
79 } 79 return document.elementFromPoint(x,y);
80 }
81
82 var njmodelGet = function njmodelGet() {
83 return (this.hasOwnProperty("_model") ? this._model: document.modelGenerator.call(this));
84 };
85
86 Object.defineProperty(Object.prototype, "_model", {
87 enumerable: false,
88 value: null,
89 writable: true
90 });
91
92 Object.defineProperty(Object.prototype, "elementModel", {
93 configurable: true,
94 get: njmodelGet,
95 set: function() {
96 }
97 });
80 </script> 98 </script>
81 99
82 <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open --> 100 <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open -->
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html
index 70187900..c74a7251 100755
--- a/js/document/templates/html/index.html
+++ b/js/document/templates/html/index.html
@@ -57,13 +57,32 @@
57 57
58 .nj-element-highlight { 58 .nj-element-highlight {
59 outline: 4px solid #ff0000; 59 outline: 4px solid #ff0000;
60 } 60 }
61 </style> 61 </style>
62 62
63 <script type="text/javascript" data-ninja-template="true"> 63 <script type="text/javascript" data-ninja-template="true">
64 function getElement(x,y) { 64
65 return document.elementFromPoint(x,y); 65 function getElement(x,y) {
66 } 66 return document.elementFromPoint(x,y);
67 }
68
69 var njmodelGet = function njmodelGet() {
70 return (this.hasOwnProperty("_model") ? this._model: document.modelGenerator.call(this));
71 };
72
73 Object.defineProperty(Object.prototype, "_model", {
74 enumerable: false,
75 value: null,
76 writable: true
77 });
78
79 Object.defineProperty(Object.prototype, "elementModel", {
80 configurable: true,
81 get: njmodelGet,
82 set: function() {
83 }
84 });
85
67 </script> 86 </script>
68 87
69 <script type="text/javascript" data-package="../app" src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> 88 <script type="text/javascript" data-package="../app" src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script>