diff options
| author | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
|---|---|---|
| committer | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
| commit | b62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch) | |
| tree | 86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo-1.7.2/dojox/dtl/DomInline.js | |
Diffstat (limited to 'js/dojo-1.7.2/dojox/dtl/DomInline.js')
| -rw-r--r-- | js/dojo-1.7.2/dojox/dtl/DomInline.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/js/dojo-1.7.2/dojox/dtl/DomInline.js b/js/dojo-1.7.2/dojox/dtl/DomInline.js new file mode 100644 index 0000000..2250c81 --- /dev/null +++ b/js/dojo-1.7.2/dojox/dtl/DomInline.js @@ -0,0 +1,44 @@ +//>>built +define("dojox/dtl/DomInline", [ + "dojo/_base/lang", + "./dom", + "./_base", + "dijit/_WidgetBase" +], function(lang,ddd,dd,Widget){ + /*===== + dd = dojox.dtl; + Widget = dijit._WidgetBase; + =====*/ + dd.DomInline = lang.extend(function(args, node){ + this.create(args, node); + }, + Widget.prototype, + { + context: null, + render: function(/*dojox.dtl.Context?*/ context){ + this.context = context || this.context; + this.postMixInProperties(); + var root = this.template.render(this.context).getRootNode(); + if(root != this.containerNode){ + this.containerNode.parentNode.replaceChild(root, this.containerNode); + this.containerNode = root; + } + }, + declaredClass: "dojox.dtl.Inline", + buildRendering: function(){ + var div = this.domNode = document.createElement("div"); + this.containerNode = div.appendChild(document.createElement("div")); + var node = this.srcNodeRef; + if(node.parentNode){ + node.parentNode.replaceChild(div, node); + } + + this.template = new dojox.dtl.DomTemplate(lang.trim(node.text), true); + this.render(); + }, + postMixInProperties: function(){ + this.context = (this.context.get === dojox.dtl._Context.prototype.get) ? this.context : new dojox.dtl.Context(this.context); + } + }); + return dojox.dtl.DomInline; +});
\ No newline at end of file |
