summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-02-25 18:07:06 +0000
committerthomascube <thomas@roundcube.net>2008-02-25 18:07:06 +0000
commite8a89e8f4c32e19e46479f527c5392d18b84c62f (patch)
treef2f34debf322b33ba3f0d939e7a575a85f4a79a2 /program/js/app.js
parente240d5b35b0c06310bb296e2850572bc13018ec0 (diff)
Fix folder adding/renaming inspired by #1484801
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 839ea5be1..aa3395335 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2702,8 +2702,14 @@ function rcube_webmail()
var refrow, form;
var tbody = this.gui_objects.subscriptionlist.tBodies[0];
- var id = replace && replace.id ? replace.id : 'rcmrow'+(tbody.childNodes.length+1);
+ var id = 'rcmrow'+(tbody.childNodes.length+1);
var selection = this.subscription_list.get_single_selection();
+
+ if (replace && replace.id)
+ {
+ id = replace.id;
+ refid = replace.id;
+ }
if (!id || !(refrow = document.getElementById(refid)))
{
@@ -2720,18 +2726,23 @@ function rcube_webmail()
else
tbody.appendChild(row);
}
-
+
// add to folder/row-ID map
this.env.subscriptionrows[row.id] = [name, display_name];
// set folder name
row.cells[0].innerHTML = display_name;
- if (row.cells[1] && row.cells[1].firstChild.tagName=='INPUT')
+
+ // set messages count to zero
+ if (!replace)
+ row.cells[1].innerHTML = '*';
+
+ if (!replace && row.cells[2] && row.cells[2].firstChild.tagName=='INPUT')
{
- row.cells[1].firstChild.value = name;
- row.cells[1].firstChild.checked = true;
+ row.cells[2].firstChild.value = name;
+ row.cells[2].firstChild.checked = true;
}
-
+
// add new folder to rename-folder list and clear input field
if (!replace && (form = this.gui_objects.editform))
{