Special XML conversion code for Firefox >= 20.0
[infodrom/rico3] / minsrc / ricoTree.js
index 9d2408f..7160644 100644 (file)
@@ -73,12 +73,17 @@ Rico.TreeControl.prototype = {
 
   atLoad : function() {
     this.treeDiv=document.createElement("div");
-    this.treeDiv.id=this.id;
     this.treeDiv.className='ricoTree';
     if (Rico.theme.treeContent) Rico.addClass(this.treeDiv,Rico.theme.treeContent);
+    var elem=Rico.$(this.id);
+    if (elem) {
+      this.setDiv(elem, { position: 'auto' });
+    } else {
+      this.treeDiv.id=this.id;
+      this.createContainer();
+    }
     this.treeDiv.style.height=this.options.height;
     this.treeDiv.style.width=this.options.width;
-    this.createContainer();
     this.content.className=Rico.theme.tree || 'ricoTreeContainer';
     this.content.appendChild(this.treeDiv);
     if (this.options.showCheckBox) {
@@ -87,19 +92,19 @@ Rico.TreeControl.prototype = {
       this.buttonDiv.className='ricoTreeButtons';
       if (Rico.getStyle(this.container,'position')=='absolute') {
         var span=document.createElement("span");
-        span.innerHTML=RicoTranslate.getPhraseById('treeSave');
+        span.innerHTML=Rico.getPhraseById('treeSave');
         Rico.setStyle(span,{'float':'left',cursor:'pointer'});
         this.buttonDiv.appendChild(span);
         Rico.eventBind(span, 'click', Rico.eventHandle(this,'saveSelection'));
       }
       var span=document.createElement("span");
-      span.innerHTML=RicoTranslate.getPhraseById('treeClear');
+      span.innerHTML=Rico.getPhraseById('treeClear');
       Rico.setStyle(span,{'float':'right',cursor:'pointer'});
       this.buttonDiv.appendChild(span);
       this.content.appendChild(this.buttonDiv);
       Rico.eventBind(span, 'click', Rico.eventHandle(this,'clrCheckBoxEvent'));
     }
-    this.close();
+    if (this.position == 'absolute') this.close();
   },
 
   setTreeDiv: function(divId) {