remove link on item without url
authorioguix <ioguix>
Sat, 23 Jun 2007 11:38:43 +0000 (11:38 +0000)
committerioguix <ioguix>
Sat, 23 Jun 2007 11:38:43 +0000 (11:38 +0000)
xloadtree/xtree2.js

index 9913fa00bc759b491da02dbd0a963b9539ca6c7a..cc45ba9e34b20a2c6b392cb2c2c298f4f6934c86 100644 (file)
@@ -801,7 +801,12 @@ _p.getRowClassName = function () {
 _p.getLabelHtml = function () {
        var toolTip = this.getToolTip();
        var target = this.getTarget();
-       return "<a href=\"" + webFXTreeHandler.textToHtml(this._getHref()) +
+       var link = this._getHref();
+
+       if (link == '#')
+               return this.getHtml();
+
+       return "<a href=\"" + webFXTreeHandler.textToHtml(link) +
                "\" class=\"webfx-tree-item-label\" tabindex=\"-1\"" +
                (toolTip ? " title=\"" + webFXTreeHandler.textToHtml(toolTip) + "\"" : "") +
                (target ? " target=\"" + target + "\"" : "") +
@@ -831,7 +836,11 @@ _p.getEventHandlersHtml = function () {
 _p.getIconHtml = function () {
        // here we are not using textToHtml since the file names rarerly contains
        // HTML...
-       return "<a href=\"" + webFXTreeHandler.textToHtml(this._getIconHref()) +
+       var link = this._getIconHref();
+       if (link == '#')
+               return "<img class=\"webfx-tree-icon\" src=\"" + this.getIconSrc() + "\">&nbsp;";
+
+       return "<a href=\"" + webFXTreeHandler.textToHtml(link) +
                "\"><img class=\"webfx-tree-icon\" src=\"" + this.getIconSrc() + "\"></a>";
 };