root / trunk / web / dojo / dojox / dtl / DomInline.js
History | View | Annotate | Download (1.22 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.dtl.DomInline"]){ |
||
9 | dojo._hasResource["dojox.dtl.DomInline"]=true; |
||
10 | dojo.provide("dojox.dtl.DomInline");
|
||
11 | dojo.require("dojox.dtl.dom");
|
||
12 | dojo.require("dijit._Widget");
|
||
13 | dojox.dtl.DomInline=dojo.extend(function(_1,_2){
|
||
14 | this.create(_1,_2);
|
||
15 | },dijit._Widget.prototype,{context:null,render:function(_3){ |
||
16 | this.context=_3||this.context; |
||
17 | this.postMixInProperties();
|
||
18 | var _4=this.template.render(this.context).getRootNode(); |
||
19 | if(_4!=this.containerNode){ |
||
20 | this.containerNode.parentNode.replaceChild(_4,this.containerNode); |
||
21 | this.containerNode=_4;
|
||
22 | } |
||
23 | },declaredClass:"dojox.dtl.Inline",buildRendering:function(){ |
||
24 | var _5=this.domNode=document.createElement("div"); |
||
25 | this.containerNode=_5.appendChild(document.createElement("div")); |
||
26 | var _6=this.srcNodeRef; |
||
27 | if(_6.parentNode){
|
||
28 | _6.parentNode.replaceChild(_5,_6); |
||
29 | } |
||
30 | this.template=new dojox.dtl.DomTemplate(dojo.trim(_6.text),true); |
||
31 | this.render();
|
||
32 | },postMixInProperties:function(){ |
||
33 | this.context=(this.context.get===dojox.dtl._Context.prototype.get)?this.context:new dojox.dtl.Context(this.context); |
||
34 | }}); |
||
35 | } |