diff options
author | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
commit | c6ae80c488621d4ac189cb63309b6258115f823a (patch) | |
tree | dfa26112e1830972fcb212bbb5b17c9a901c645f /node_modules/montage/ui/template.js | |
parent | 022e714cb5d10cd8575ab9907eddfb184a990b66 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-c6ae80c488621d4ac189cb63309b6258115f823a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into Timeline-merge-candidate
Diffstat (limited to 'node_modules/montage/ui/template.js')
-rwxr-xr-x | node_modules/montage/ui/template.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/node_modules/montage/ui/template.js b/node_modules/montage/ui/template.js index eb44a9b5..014daed5 100755 --- a/node_modules/montage/ui/template.js +++ b/node_modules/montage/ui/template.js | |||
@@ -18,7 +18,7 @@ var Serializer = require("core/serializer").Serializer; | |||
18 | var Deserializer = require("core/deserializer").Deserializer; | 18 | var Deserializer = require("core/deserializer").Deserializer; |
19 | var logger = require("core/logger").logger("template"); | 19 | var logger = require("core/logger").logger("template"); |
20 | var defaultEventManager = require("core/event/event-manager").defaultEventManager; | 20 | var defaultEventManager = require("core/event/event-manager").defaultEventManager; |
21 | var applicationExports = require("ui/application"); | 21 | var defaultApplication; |
22 | 22 | ||
23 | /** | 23 | /** |
24 | @class module:montage/ui/template.Template | 24 | @class module:montage/ui/template.Template |
@@ -261,8 +261,11 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
261 | 261 | ||
262 | _deserialize: { | 262 | _deserialize: { |
263 | value: function(instances, targetDocument, callback) { | 263 | value: function(instances, targetDocument, callback) { |
264 | var self = this, | 264 | if ( typeof defaultApplication === "undefined") { |
265 | defaultApplication = applicationExports.application; | 265 | defaultApplication = require("ui/application").application; |
266 | } | ||
267 | |||
268 | var self = this; | ||
266 | 269 | ||
267 | this.getDeserializer(function(deserializer) { | 270 | this.getDeserializer(function(deserializer) { |
268 | var externalObjects; | 271 | var externalObjects; |
@@ -623,7 +626,9 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
623 | var style = doc.importNode(cssTag,false); | 626 | var style = doc.importNode(cssTag,false); |
624 | style.href = url; | 627 | style.href = url; |
625 | container.insertBefore(style, container.firstChild); | 628 | container.insertBefore(style, container.firstChild); |
626 | container.insertBefore(doc.createComment("Inserted from " + this._id), container.firstChild); | 629 | if (logger.isDebug) { |
630 | container.insertBefore(doc.createComment("Inserted from " + this._id), container.firstChild); | ||
631 | } | ||
627 | 632 | ||
628 | var loadHandler = function(event) { | 633 | var loadHandler = function(event) { |
629 | if (++self._stylesLoadedCount === self._expectedStylesLoadedCount) { | 634 | if (++self._stylesLoadedCount === self._expectedStylesLoadedCount) { |
@@ -659,7 +664,9 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
659 | 664 | ||
660 | } else { | 665 | } else { |
661 | container.insertBefore(doc.importNode(cssTag, true), container.firstChild); | 666 | container.insertBefore(doc.importNode(cssTag, true), container.firstChild); |
662 | container.insertBefore(doc.createComment("Inserted from " + this._id), container.firstChild); | 667 | if (logger.isDebug) { |
668 | container.insertBefore(doc.createComment("Inserted from " + this._id), container.firstChild); | ||
669 | } | ||
663 | } | 670 | } |
664 | } | 671 | } |
665 | 672 | ||
@@ -724,7 +731,9 @@ var Template = exports.Template = Montage.create(Montage, /** @lends module:mont | |||
724 | if (src in externalScriptsLoaded) continue; | 731 | if (src in externalScriptsLoaded) continue; |
725 | externalScriptsLoaded[src] = true; | 732 | externalScriptsLoaded[src] = true; |
726 | } | 733 | } |
727 | container.appendChild(doc.createComment("Inserted from " + this._id)); | 734 | if (logger.isDebug) { |
735 | container.appendChild(doc.createComment("Inserted from " + this._id)); | ||
736 | } | ||
728 | container.appendChild(scriptNode); | 737 | container.appendChild(scriptNode); |
729 | } | 738 | } |
730 | 739 | ||