pcirella / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

tooltip doesn't support the caracter ' (apostrophe) #226

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a child node with a tooltip "te'st"

expected result : the node display a tooltip "te'st"
actual result :  the node display a tooltip "te"

To fix this issue, I change the code at the lignes 218 :

Before :
        if(!nodeTitle){
            var tooltip = data.tooltip ? " title='" + data.tooltip + "'" : "";
            if( opts.noLink || data.noLink ) {
                nodeTitle = "<span style='display: inline-block;' class='" + opts.classNames.title + "'" + tooltip + ">" + data.title + "</span>";
//              this.tree.logDebug("nodeTitle: " + nodeTitle);
            }else{
                nodeTitle = "<a href='#' class='" + opts.classNames.title + "'" + tooltip + ">" + data.title + "</a>";
            }
        }
After (fix) :
        if(!nodeTitle){
            var tooltip = data.tooltip ? ' title="' + data.tooltip.replace(/\"/g, '&quot;') + '"' : '';
            if( opts.noLink || data.noLink ) {
                nodeTitle = '<span style="display:inline-block;" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</span>';
//              this.tree.logDebug("nodeTitle: " + nodeTitle);
            } else {
                nodeTitle = '<a href="#" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</a>';
            }
        }

Original issue reported on code.google.com by eric.bla...@gmail.com on 10 Sep 2011 at 10:48

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 11 Sep 2011 at 2:27

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r532.

Original comment by moo...@wwwendt.de on 20 Oct 2011 at 8:43