source: Dev/branches/rest-dojo-ui/client/dojox/dtl/Inline.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.1 KB
Line 
1define([
2        "dojo/_base/lang",
3        "./_base",
4        "dijit/_WidgetBase",
5        "dojo/query" // dojo.query
6], function(lang,dd,Widget,Query){
7        /*=====
8                Widget = dijit._WidgetBase;
9                Query = dojo.query;
10                dd = dojox.dtl;
11        =====*/
12        dd.Inline = lang.extend(function(args, node){
13                this.create(args, node);
14        },
15        Widget.prototype,
16        {
17                context: null,
18                render: function(/*Object|dojox.dtl.Context?*/ context){
19                        this.context = context || this.context;
20                        this.postMixInProperties();
21                        Query("*", this.domNode).orphan();
22                        this.domNode.innerHTML = this.template.render(this.context);
23                },
24                declaredClass: "dojox.dtl.Inline",
25                buildRendering: function(){
26                        var div = this.domNode = document.createElement("div");
27                        var node = this.srcNodeRef;
28                        if(node.parentNode){
29                                node.parentNode.replaceChild(div, node);
30                        }
31
32                        this.template = new dd.Template(lang.trim(node.text), true);
33                        this.render();
34                },
35                postMixInProperties: function(){
36                        this.context = (this.context.get === dd._Context.prototype.get) ? this.context : new dd._Context(this.context);
37                }
38        });
39        return dojox.dtl.Inline;
40});
Note: See TracBrowser for help on using the repository browser.