Ticket #1728: 1728.2.patch
| File 1728.2.patch, 5.6 kB (added by doughays, 2 years ago) |
|---|
-
src/widget/templates/TreeV3.css
37 37 */ 38 38 39 39 .TreeExpandLoading { 40 width: 18px;41 height: 18px;42 float: left;43 display: inline;44 40 background-repeat : no-repeat; 45 41 background-image: url('../templates/images/TreeV3/expand_loading.gif'); 46 42 } … … 48 44 .TreeContent { 49 45 min-height: 18px; 50 46 min-width: 18px; 51 margin-left: 18px;47 margin-left:0px; 52 48 cursor: default; 53 49 /* can't make inline - multiline bugs */ 50 background-repeat : no-repeat; 54 51 } 55 52 56 53 .TreeIEContent { 57 54 height: 18px; 58 55 } 59 56 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; 66 60 } 67 61 68 62 /* same style as IE selection */ 69 63 .TreeNodeEmphasized { 70 64 background-color: Highlight; 71 65 color: HighlightText; 72 66 } 67 68 .TreeContent .RichTextEditable, .TreeContent .RichTextEditable iframe { 69 background-color: #ffc; 70 color: black; 71 } 73 72 74 73 /* don't use :focus due to opera's lack of support on div's */ 75 74 .TreeLabelFocused { -
src/widget/TreeBasicControllerV3.js
318 318 } 319 319 }, 320 320 321 onTreeMouseDown: function(e) {322 },321 onTreeMouseDown: function(e) { 322 }, 323 323 324 324 onTreeClick: function(e){ 325 325 //dojo.profile.start("onTreeClick"); … … 327 327 var domElement = e.target; 328 328 //dojo.debug('click') 329 329 // find node 330 var node = this.domElement2TreeNode(domElement);330 var node = this.domElement2TreeNode(domElement); 331 331 if (!node || !node.isTreeNode) { 332 332 return; 333 333 } 334 334 335 335 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 } 339 340 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 } 342 347 } 343 348 344 349 this._focusLabel(node); -
src/widget/TreeNodeV3.js
30 30 labelClass: "", 31 31 contentClass: "", 32 32 33 expandNode: null,34 33 labelNode: null, 35 34 36 35 /** … … 98 97 99 98 100 99 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'); 103 102 }, 104 103 105 104 unmarkProcessing: function() { 106 dojo.html.setClass(this. expandNode, this.markProcessingSavedClass);105 dojo.html.setClass(this.contentNode, this.markProcessingSavedClass); 107 106 }, 108 107 109 108 … … 129 128 //dojo.profile.start("buildRendering - cloneNode"); 130 129 131 130 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; 134 132 this.labelNode = this.contentNode.firstChild; 135 133 136 134 if (this.labelClass) { -
src/widget/TreeV3.js
119 119 }, 120 120 121 121 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. 123 123 // selection in KHTML/Mozilla disabled treewide, IE requires unselectable for every node 124 124 // you can add unselectable if you want both in postCreate of tree and in this template 125 125 … … 130 130 dojo.html.setClass(domNode, this.classPrefix+"Node "+this.classPrefix+"ExpandLeaf "+this.classPrefix+"ChildrenNo"); 131 131 this.nodeTemplate = domNode; 132 132 133 var expandNode = document.createElement("div");133 var contentNode = document.createElement("div"); 134 134 var clazz = this.classPrefix+"Expand"; 135 135 if (dojo.render.html.ie) { 136 136 clazz = clazz + ' ' + this.classPrefix+"IEExpand"; 137 137 } 138 dojo.html.setClass( expandNode, clazz);138 dojo.html.setClass(contentNode, clazz); 139 139 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"); 145 141 dojo.html.setClass(labelNode, this.classPrefix+"Label"); 146 142 this.labelNodeTemplate = labelNode; 147 143 148 var contentNode = document.createElement("div");149 144 var clazz = this.classPrefix+"Content"; 150 145 151 146 /** … … 158 153 } 159 154 160 155 161 dojo.html. setClass(contentNode, clazz);156 dojo.html.addClass(contentNode, clazz); 162 157 163 158 this.contentNodeTemplate = contentNode; 164 165 domNode.appendChild(expandNode); 159 166 160 domNode.appendChild(contentNode); 167 161 contentNode.appendChild(labelNode); 168 162 169 170 163 }, 171 164 172 165 makeContainerNodeTemplate: function() {