svncommit
2007-02-21 9bebdfcb6ad7e91a218e5811f6fce9e1a956ecc8
Sort subscription folder list after adding or renaming a folder.


1 files modified
28 ■■■■■ changed files
program/js/app.js 28 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -2585,6 +2585,7 @@
        form.elements['_folder_name'].value = ''; 
      }
    this.sort_subscription_list();
    };
@@ -2733,6 +2734,33 @@
    return new_row;
    };
  // sort subscription folder list
  this.sort_subscription_list = function()
    {
    var tbody = this.gui_objects.subscriptionlist.tBodies[0];
    for (var i = 0; i<(tbody.childNodes.length-1); i++)
      {
      if (this.env.subscriptionrows[tbody.childNodes[i].id]!=null)
        {
        var swapped = false;
        for (var j = i+1; j<(tbody.childNodes.length); j++)
          {
          if ((this.env.subscriptionrows[tbody.childNodes[j].id]!=null) &&
              (this.env.subscriptionrows[tbody.childNodes[i].id][0]>
               this.env.subscriptionrows[tbody.childNodes[j].id][0]))
            {
            var swap = tbody.replaceChild(tbody.childNodes[i], tbody.childNodes[j]);
            if (typeof(tbody.childNodes[i]) != 'undefined')
              tbody.insertBefore(swap, tbody.childNodes[i])
            else
              tbody.appendChild(swap);
            swapped = true;
            }
          }
        }
      }
    };
  /*********************************************************/
  /*********           GUI functionality           *********/