summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-02-05 17:30:01 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-02-05 17:30:01 +0100
commite8fd39d12b4649d94d63d220d2201169b6dece08 (patch)
tree34b08a8288a113f7f55adea6df1f1db17b447b70 /program/js/app.js
parent5bc800f946e39ae0c5afcca79d6ae0af561fc536 (diff)
Fix inserting a new contact group when list is still empty
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 7c6dba8c0..57ef903eb 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4438,7 +4438,10 @@ function rcube_webmail()
this.name_input_li = $('<li>').addClass(type).append(this.name_input);
var li = type == 'contactsearch' ? $('li:last', this.gui_objects.folderlist) : $('ul.groups li:last', this.get_folder_li(this.env.source,'',true));
- this.name_input_li.insertAfter(li);
+ if (li.length)
+ this.name_input_li.insertAfter(li);
+ else
+ this.name_input_li.appendTo(type == 'contactsearch' ? this.gui_objects.folderlist : $('ul.groups', this.get_folder_li(this.env.source,'',true)));
}
this.name_input.select().focus();