From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- .../_WidgetsInTemplateMixin.js.uncompressed.js | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/dijit/_WidgetsInTemplateMixin.js.uncompressed.js (limited to 'lib/dijit/_WidgetsInTemplateMixin.js.uncompressed.js') diff --git a/lib/dijit/_WidgetsInTemplateMixin.js.uncompressed.js b/lib/dijit/_WidgetsInTemplateMixin.js.uncompressed.js new file mode 100644 index 000000000..af7e5d221 --- /dev/null +++ b/lib/dijit/_WidgetsInTemplateMixin.js.uncompressed.js @@ -0,0 +1,61 @@ +define("dijit/_WidgetsInTemplateMixin", [ + "dojo/_base/array", // array.forEach + "dojo/_base/declare", // declare + "dojo/parser", // parser.parse + "dijit/registry" // registry.findWidgets +], function(array, declare, parser, registry){ + + // module: + // dijit/_WidgetsInTemplateMixin + // summary: + // Mixin to supplement _TemplatedMixin when template contains widgets + + return declare("dijit._WidgetsInTemplateMixin", null, { + // summary: + // Mixin to supplement _TemplatedMixin when template contains widgets + + // _earlyTemplatedStartup: Boolean + // A fallback to preserve the 1.0 - 1.3 behavior of children in + // templates having their startup called before the parent widget + // fires postCreate. Defaults to 'false', causing child widgets to + // have their .startup() called immediately before a parent widget + // .startup(), but always after the parent .postCreate(). Set to + // 'true' to re-enable to previous, arguably broken, behavior. + _earlyTemplatedStartup: false, + + // widgetsInTemplate: [protected] Boolean + // Should we parse the template to find widgets that might be + // declared in markup inside it? (Remove for 2.0 and assume true) + widgetsInTemplate: true, + + _beforeFillContent: function(){ + if(this.widgetsInTemplate){ + // Before copying over content, instantiate widgets in template + var node = this.domNode; + + var cw = (this._startupWidgets = parser.parse(node, { + noStart: !this._earlyTemplatedStartup, + template: true, + inherited: {dir: this.dir, lang: this.lang, textDir: this.textDir}, + propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me + scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type + })); + + this._supportingWidgets = registry.findWidgets(node); + + this._attachTemplateNodes(cw, function(n,p){ + return n[p]; + }); + } + }, + + startup: function(){ + array.forEach(this._startupWidgets, function(w){ + if(w && !w._started && w.startup){ + w.startup(); + } + }); + this.inherited(arguments); + } + }); +}); -- cgit v1.2.3