diff options
| author | robin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-02-21 08:34:23 +0000 |
|---|---|---|
| committer | robin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-02-21 08:34:23 +0000 |
| commit | ad132169739f65b2ed2e97dfb550e6b538e652b1 (patch) | |
| tree | 47b04ee9a61b4885004ec0c87749513429cc99ca /roundcubemail/program | |
| parent | 21c966a05c5e90e1611f33fed2aafc1c76ba05c1 (diff) | |
Sort subscription folder list after adding or renaming a folder.
git-svn-id: https://svn.roundcube.net/trunk@488 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/js/app.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index 0a1afe8af..34fa68572 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -2585,6 +2585,7 @@ function rcube_webmail() form.elements['_folder_name'].value = ''; } + this.sort_subscription_list(); }; @@ -2733,6 +2734,33 @@ function rcube_webmail() 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 *********/ |
