Changeset 1080 for trunk/modules/Dialogs


Ignore:
Timestamp:
10/12/08 15:44:54 (11 years ago)
Author:
ray
Message:
  • #1303 add getElementsByClassName()
  • #1302 add Array.prototype.forEach for Browser that doesn't support it
  • new version of about box implemented as module using new dialogs
  • new version of dojo js compressor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/Dialogs/XinhaDialog.js

    r1075 r1080  
    159159  rootElem.appendChild(main); 
    160160  main.innerHTML = html; 
    161  
     161   
    162162  //make the first h1 to drag&drop the rootElem 
    163163  var captionBar = main.removeChild( main.getElementsByTagName("h1")[0]); 
     
    259259      bottom = "0px"; 
    260260      right= "0px"; 
     261      MozUserSelect = 'none'; 
    261262    } 
    262263    Xinha._addEvent(this.resizer, 'mousedown', function(ev) { dialog.resizeStart(ev); }); 
     
    513514  } 
    514515}; 
    515  
     516/** Equivalent to document.getElementById. You can't use document.getElementById because id's are dynamic to avoid id clashes between plugins 
     517 * @type {Element} 
     518 * @param {String} id 
     519 */ 
    516520Xinha.Dialog.prototype.getElementById = function(id) 
    517521{ 
    518522  return this.document.getElementById(this.id[id] ? this.id[id] : id); 
    519523}; 
    520  
     524/** Equivalent to document.getElementByName. You can't use document.getElementByName because names are dynamic to avoid name clashes between plugins 
     525 * @type {Array} 
     526 * @param {String} name 
     527 */ 
    521528Xinha.Dialog.prototype.getElementsByName = function(name) 
    522529{ 
    523   return this.document.getElementsByName(this.id[name] ? this.id[name] : name); 
     530  var els = this.document.getElementsByName(this.id[name] ? this.id[name] : name);  
     531  return els.length ? Array.prototype.slice.call(els) : []; //Collection to Array 
     532}; 
     533/** Return all elements in the dialog that have the given class 
     534 * @type {Array}  
     535 * @param {String} className 
     536 */ 
     537Xinha.Dialog.prototype.getElementsByClassName = function(className) 
     538{ 
     539  return Xinha.getElementsByClassName(this.rootElem,className); 
    524540}; 
    525541 
Note: See TracChangeset for help on using the changeset viewer.