dojox/dtl/contrib/dom.js

  • Provides:

    • dojox.dtl.contrib.dom
  • Requires:

    • dojox.dtl.dom in common
  • dojox.dtl.contrib.dom.StyleNode

    • type
      Function
    • parameters:
      • styles: (typeof )
    • source: [view]
        this.contents = {};
        this._current = {};
        this._styles = styles;
        for(var key in styles){
         if(styles[key].indexOf("{{") != -1){
          var node = new dd.Template(styles[key]);
         }else{
          var node = dojo.delegate(simple);
          node.contents = styles[key];
         }
         this.contents[key] = node;
        }
    • summary
  • dojox.dtl.contrib.dom.BufferNode

    • type
      Function
    • parameters:
      • nodelist: (typeof )
      • options: (typeof )
    • source: [view]
        this.nodelist = nodelist;
        this.options = options;
    • summary
  • dojox.dtl.contrib.dom.StyleNode.contents

    • summary
  • dojox.dtl.contrib.dom.StyleNode._current

    • summary
  • dojox.dtl.contrib.dom.StyleNode._styles

    • summary
  • dojox.dtl.contrib.dom.StyleNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         for(var key in this.contents){
          var value = this.contents[key].render(context);
          if(this._current[key] != value){
           dojo.style(buffer.getParent(), key, this._current[key] = value);
          }
         }
         return buffer;
    • summary
  • dojox.dtl.contrib.dom.StyleNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         this._current = {};
         return buffer;
    • summary
  • dojox.dtl.contrib.dom.StyleNode.clone

    • type
      Function
    • parameters:
      • buffer: (typeof )
    • source: [view]
         return new this.constructor(this._styles);
    • summary
  • dojox.dtl.contrib.dom.BufferNode.nodelist

    • summary
  • dojox.dtl.contrib.dom.BufferNode.options

    • summary
  • dojox.dtl.contrib.dom.BufferNode._swap

    • type
      Function
    • parameters:
      • type: (typeof )
      • node: (typeof )
    • source: [view]
         if(!this.swapped && this.parent.parentNode){
          if(type == "node"){
           if((node.nodeType == 3 && !this.options.text) || (node.nodeType == 1 && !this.options.node)){
            return;
           }
          }else if(type == "class"){
           if(type != "class"){
            return;
           }
          }


          this.onAddNode && dojo.disconnect(this.onAddNode);
          this.onRemoveNode && dojo.disconnect(this.onRemoveNode);
          this.onChangeAttribute && dojo.disconnect(this.onChangeAttribute);
          this.onChangeData && dojo.disconnect(this.onChangeData);


          this.swapped = this.parent.cloneNode(true);
          this.parent.parentNode.replaceChild(this.swapped, this.parent);
         }
    • summary
  • dojox.dtl.contrib.dom.BufferNode.swapped

    • summary
  • dojox.dtl.contrib.dom.BufferNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         this.parent = buffer.getParent();
         if(this.options.node){
          this.onAddNode = dojo.connect(buffer, "onAddNode", dojo.hitch(this, "_swap", "node"));
          this.onRemoveNode = dojo.connect(buffer, "onRemoveNode", dojo.hitch(this, "_swap", "node"));
         }
         if(this.options.text){
          this.onChangeData = dojo.connect(buffer, "onChangeData", dojo.hitch(this, "_swap", "node"));
         }
         if(this.options["class"]){
          this.onChangeAttribute = dojo.connect(buffer, "onChangeAttribute", dojo.hitch(this, "_swap", "class"));
         }


         buffer = this.nodelist.render(context, buffer);


         if(this.swapped){
          this.swapped.parentNode.replaceChild(this.parent, this.swapped);
          dojo.destroy(this.swapped);
         }else{
          this.onAddNode && dojo.disconnect(this.onAddNode);
          this.onRemoveNode && dojo.disconnect(this.onRemoveNode);
          this.onChangeAttribute && dojo.disconnect(this.onChangeAttribute);
          this.onChangeData && dojo.disconnect(this.onChangeData);
         }


         delete this.parent;
         delete this.swapped;
         return buffer;
    • summary
  • dojox.dtl.contrib.dom.BufferNode.parent

    • summary
  • dojox.dtl.contrib.dom.BufferNode.onAddNode

    • summary
  • dojox.dtl.contrib.dom.BufferNode.onRemoveNode

    • summary
  • dojox.dtl.contrib.dom.BufferNode.onChangeData

    • summary
  • dojox.dtl.contrib.dom.BufferNode.onChangeAttribute

    • summary
  • dojox.dtl.contrib.dom.BufferNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         return this.nodelist.unrender(context, buffer);
    • summary
  • dojox.dtl.contrib.dom.BufferNode.clone

    • type
      Function
    • parameters:
      • buffer: (typeof )
    • source: [view]
         return new this.constructor(this.nodelist.clone(buffer), this.options);
    • summary
  • dojox.dtl.contrib.dom

    • type
      Object
    • summary
  • dojox.dtl.contrib

    • type
      Object
    • summary
  • dojox.dtl

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary