Ticket #1728: 1728.2.patch

File 1728.2.patch, 5.6 kB (added by doughays, 2 years ago)

refreshed patch with Ilia's click region suggestion implemented

  • src/widget/templates/TreeV3.css

     
    3737*/ 
    3838 
    3939.TreeExpandLoading   { 
    40     width: 18px; 
    41     height: 18px; 
    42     float: left; 
    43     display: inline; 
    4440    background-repeat : no-repeat; 
    4541    background-image: url('../templates/images/TreeV3/expand_loading.gif'); 
    4642} 
     
    4844.TreeContent { 
    4945    min-height: 18px; 
    5046    min-width: 18px; 
    51     margin-left:18px; 
     47    margin-left:0px; 
    5248    cursor: default; 
    5349    /* can't make inline - multiline bugs */ 
     50    background-repeat : no-repeat; 
    5451} 
    5552 
    5653.TreeIEContent { 
    5754        height: 18px; 
    5855} 
    5956  
    60 .TreeExpand { 
    61     width: 18px; 
    62     height: 18px; 
    63     float: left; 
    64     display: inline; 
    65     background-repeat : no-repeat; 
     57.TreeLabel { 
     58    left: 18px; 
     59    position: relative; 
    6660} 
    67   
     61 
    6862/* same style as IE selection */ 
    6963.TreeNodeEmphasized { 
    7064    background-color: Highlight; 
    7165    color: HighlightText; 
    7266} 
     67  
     68.TreeContent .RichTextEditable, .TreeContent .RichTextEditable iframe { 
     69      background-color: #ffc; 
     70      color: black; 
     71} 
    7372 
    7473/* don't use :focus due to opera's lack of support on div's */ 
    7574.TreeLabelFocused { 
  • src/widget/TreeBasicControllerV3.js

     
    318318                } 
    319319        }, 
    320320 
    321     onTreeMouseDown: function(e) { 
    322     }, 
     321        onTreeMouseDown: function(e) { 
     322        }, 
    323323 
    324324        onTreeClick: function(e){ 
    325325                //dojo.profile.start("onTreeClick"); 
     
    327327                var domElement = e.target; 
    328328                //dojo.debug('click') 
    329329                // find node 
    330         var node = this.domElement2TreeNode(domElement);                 
     330                var node = this.domElement2TreeNode(domElement);                 
    331331                if (!node || !node.isTreeNode) { 
    332332                        return; 
    333333                } 
    334334                 
    335335                 
    336                 var checkExpandClick = function(el) { 
    337                         return el === node.expandNode; 
    338                 } 
     336                if (domElement == node.contentNode) { 
     337                        var checkExpandClick = function(el) { 
     338                                return el === node.contentNode; 
     339                        } 
    339340                 
    340                 if (this.checkPathCondition(domElement, checkExpandClick)) { 
    341                         this.processExpandClick(node);                   
     341                        if (this.checkPathCondition(domElement, checkExpandClick)) { 
     342                                var y = e.pageY - dojo.html.getAbsolutePosition(node.labelNode, true, dojo.html.boxSizing.MARGIN_BOX).y; 
     343                                if (y <= dojo.html.getPixelValue (node.labelNode,"left")){ 
     344                                        this.processExpandClick(node);                   
     345                                } 
     346                        } 
    342347                } 
    343348                 
    344349                this._focusLabel(node); 
  • src/widget/TreeNodeV3.js

     
    3030        labelClass: "", 
    3131        contentClass: "", 
    3232 
    33         expandNode: null, 
    3433        labelNode: null, 
    3534                 
    3635    /** 
     
    9897                                 
    9998                         
    10099        markProcessing: function() { 
    101                 this.markProcessingSavedClass = dojo.html.getClass(this.expandNode); 
    102                 dojo.html.setClass(this.expandNode, this.tree.classPrefix+'ExpandLoading');                      
     100                this.markProcessingSavedClass = dojo.html.getClass(this.contentNode); 
     101                dojo.html.setClass(this.contentNode, this.tree.classPrefix+'ExpandLoading');                     
    103102        }, 
    104103         
    105104        unmarkProcessing: function() { 
    106                 dojo.html.setClass(this.expandNode, this.markProcessingSavedClass);                      
     105                dojo.html.setClass(this.contentNode, this.markProcessingSavedClass);                     
    107106        }, 
    108107         
    109108         
     
    129128                //dojo.profile.start("buildRendering - cloneNode"); 
    130129                 
    131130                this.domNode = this.tree.nodeTemplate.cloneNode(true); 
    132                 this.expandNode = this.domNode.firstChild; 
    133                 this.contentNode = this.domNode.childNodes[1]; 
     131                this.contentNode = this.domNode.firstChild; 
    134132                this.labelNode = this.contentNode.firstChild; 
    135133                 
    136134                if (this.labelClass) { 
  • src/widget/TreeV3.js

     
    119119        }, 
    120120                                 
    121121 
    122         // expandNode has +- CSS background. Not img.src for performance, background src string resides in single place. 
     122        // contentNode has +- CSS background. Not img.src for performance, background src string resides in single place. 
    123123        // selection in KHTML/Mozilla disabled treewide, IE requires unselectable for every node 
    124124        // you can add unselectable if you want both in postCreate of tree and in this template 
    125125 
     
    130130                dojo.html.setClass(domNode, this.classPrefix+"Node "+this.classPrefix+"ExpandLeaf "+this.classPrefix+"ChildrenNo");              
    131131                this.nodeTemplate = domNode; 
    132132                 
    133                 var expandNode = document.createElement("div"); 
     133                var contentNode = document.createElement("div"); 
    134134                var clazz = this.classPrefix+"Expand"; 
    135135                if (dojo.render.html.ie) { 
    136136                        clazz = clazz + ' ' + this.classPrefix+"IEExpand"; 
    137137                } 
    138                 dojo.html.setClass(expandNode, clazz); 
     138                dojo.html.setClass(contentNode, clazz); 
    139139                 
    140                 this.expandNodeTemplate = expandNode; 
    141  
    142                 // need <span> inside <div> 
    143                 // div for multiline support, span for styling exactly the text, not whole line 
    144                 var labelNode = document.createElement("span"); 
     140                var labelNode = document.createElement("div"); 
    145141                dojo.html.setClass(labelNode, this.classPrefix+"Label"); 
    146142                this.labelNodeTemplate = labelNode; 
    147143                 
    148                 var contentNode = document.createElement("div"); 
    149144                var clazz = this.classPrefix+"Content"; 
    150145                 
    151146                /** 
     
    158153                }        
    159154                 
    160155                                 
    161                 dojo.html.setClass(contentNode, clazz); 
     156                dojo.html.addClass(contentNode, clazz); 
    162157                 
    163158                this.contentNodeTemplate = contentNode; 
    164                  
    165                 domNode.appendChild(expandNode); 
     159 
    166160                domNode.appendChild(contentNode); 
    167161                contentNode.appendChild(labelNode); 
    168162                 
    169                  
    170163        }, 
    171164 
    172165        makeContainerNodeTemplate: function() {