Changeset 11218
- Timestamp:
- 10/30/07 03:51:05 (10 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/_base/html.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/html.js
r11140 r11218 14 14 // ============================= 15 15 16 /*===== 17 dojo.byId = function(id, doc){ 18 // summary: 19 // similar to other library's "$" function, takes a 20 // string representing a DOM id or a DomNode and 21 // returns the corresponding DomNode. If a Node is 22 // passed, this function is a no-op. Returns a 23 // single DOM node or null, working around several 24 // browser-specific bugs to do so. 25 // id: String|DomNode 26 // DOM id or DOM Node 27 // doc: DocumentElement? 28 // optional, defaults to the current value of 29 // dojo.doc. Can be used to retreive 30 // node references from other documents. 31 // return: 32 // DomNode 33 } 34 =====*/ 35 16 36 if(dojo.isIE || dojo.isOpera){ 17 dojo.byId = function(/*String*/id, /*DocumentElement*/doc){ 18 // summary: 19 // similar to other library's "$" function, takes a 20 // string representing a DOM id or a DomNode and 21 // returns the corresponding DomNode. If a Node is 22 // passed, this function is a no-op. Returns a 23 // single DOM node or null, working around several 24 // browser-specific bugs to do so. 25 // id: DOM id or DOM Node 26 // doc: 27 // optional, defaults to the current value of 28 // dojo.doc. Can be used to retreive 29 // node references from other documents. 37 dojo.byId = function(id, doc){ 30 38 if(dojo.isString(id)){ 31 39 var _d = doc || dojo.doc; … … 50 58 } 51 59 }else{ 52 dojo.byId = function(/*String*/id, /*DocumentElement*/doc){ 53 // summary: 54 // similar to other library's "$" function, takes a 55 // string representing a DOM id or a DomNode and 56 // returns the corresponding DomNode. If a Node is 57 // passed, this function is a no-op. Returns a 58 // single DOM node or null, working around several 59 // browser-specific bugs to do so. 60 // id: DOM id or DOM Node 61 // doc: 62 // optional, defaults to the current value of 63 // dojo.doc. Can be used to retreive 64 // node references from other documents. 60 dojo.byId = function(id, doc){ 65 61 if(dojo.isString(id)){ 66 62 return (doc || dojo.doc).getElementById(id); … … 99 95 }; 100 96 101 dojo.isDescendant = function(/* Node|String*/node, /*Node|String*/ancestor){97 dojo.isDescendant = function(/*DomNode|String*/node, /*DomNode|String*/ancestor){ 102 98 // summary: 103 99 // Returns true if node is a descendant of ancestor … … 117 113 }; 118 114 119 dojo.setSelectable = function(/*Node|String*/node, /*Boolean*/selectable){ 120 // summary: enable or disable selection on a node 115 dojo.setSelectable = function(/*DomNode|String*/node, /*Boolean*/selectable){ 116 // summary: enable or disable selection on a node 117 // node: 118 // id or reference to node 119 // selectable: 121 120 node = dojo.byId(node); 122 121 if(dojo.isMozilla){ … … 247 246 dojo.getComputedStyle = function(node){ //DomNode 248 247 // summary: 249 // returns a "computed style" object which can be used to 250 // gather information about the current state of the 251 // rendered node. 252 // Note that this may behave differently on different 253 // browsers. Values may have different formats and value 254 // encodings across browsers. 248 // returns a "computed style" object. 249 // description: 250 // get "computed style" object which can be used to gather 251 // information about the current state of the rendered node. 252 // 253 // Note that this may behave differently on different browsers. 254 // Values may have different formats and value encodings across 255 // browsers. 256 // 255 257 // Use the dojo.style() method for more consistent (pixelized) 256 258 // return values. … … 321 323 322 324 // FIXME: there opacity quirks on FF that we haven't ported over. Hrm. 323 324 dojo._getOpacity = (dojo.isIE ? function(/*DomNode*/node){325 /*===== 326 dojo._getOpacity = function(node){ 325 327 // summary: 326 328 // returns the current opacity of the passed node as a 327 329 // floating-point value between 0 and 1. 328 // node: 330 // node: DomNode 329 331 // a reference to a DOM node. Does NOT support taking an 330 332 // ID string for speed reasons. 333 // return: Number between 0 and 1 334 } 335 =====*/ 336 337 dojo._getOpacity = (dojo.isIE ? function(node){ 331 338 try{ 332 339 return (node.filters.alpha.opacity / 100); // Number … … 339 346 ); 340 347 341 dojo._setOpacity = (dojo.isIE ? function(/*DomNode*/node, /*Number*/opacity){ 348 /*===== 349 dojo._setOpacity = function(node, opacity){ 342 350 // summary: 343 351 // set the opacity of the passed node portably. Returns the … … 348 356 // opacity: 349 357 // Number between 0 and 1. 0 specifies transparent. 358 // return: Number between 0 and 1 359 } 360 =====*/ 361 362 dojo._setOpacity = (dojo.isIE ? function(/*DomNode*/node, /*Number*/opacity){ 350 363 if(opacity == 1){ 351 364 // on IE7 Alpha(Filter opacity=100) makes text look fuzzy so remove it altogether (bug #2661)