diff --git a/plugins/kolab_folders/kolab_folders.js b/plugins/kolab_folders/kolab_folders.js index 30d81704..a710657e 100644 --- a/plugins/kolab_folders/kolab_folders.js +++ b/plugins/kolab_folders/kolab_folders.js @@ -25,7 +25,31 @@ * for the JavaScript code in this file. */ -$(document).ready(function() { +window.rcmail && rcmail.env.action == 'folders' && rcmail.addEventListener('init', function() { + var filter = $(rcmail.gui_objects.foldersfilter), + optgroup = $('').attr('label', rcmail.gettext('kolab_folders.folderctype')); + + // remove disabled namespaces + filter.children('option').each(function(i, opt) { + $.each(rcmail.env.skip_roots || [], function() { + if (opt.value == this) { + $(opt).remove(); + } + }); + }); + + // add type options to the filter + $.each(rcmail.env.foldertypes, function() { + optgroup.append($('