Edgewall Software

Ticket #234: bitten-tabset.patch

File bitten-tabset.patch, 0.8 KB (added by J. Kyllo <jkyllo-trac@…>, 12 months ago)

A patch changing the makeTab function to create a title element if necessary.

  • bitten/htdocs/tabset.js

     
    55 
    66  function makeTab(div) { 
    77    var title = div.firstChild; 
    8     while (title.nodeType != 1) title = title.nextSibling; 
     8    while (title.nodeType != 1) { 
     9    if(!title.nextSibling) { 
     10        /* The input div has not sub-structure, so create some */ 
     11        var newtitle = document.createElement("h3"); 
     12        newtitle.appendChild(document.createTextNode("None")); 
     13        div.insertBefore(newtitle, title); 
     14        title = newtitle; 
     15    } else { 
     16        title = title.nextSibling; 
     17    } 
     18    } 
    919    var tabItem = document.createElement("li"); 
    1020    if (!tabList.childNodes.length) tabItem.className = "active"; 
    1121    var link = document.createElement("a");