Thomas Bruederli
2014-08-13 48e340a82938a83ff337eadb7d6d64c2b13acffe
program/js/app.js
@@ -4739,6 +4739,7 @@
  this.list_contacts = function(src, group, page)
  {
    var win, folder, url = {},
      refresh = src === undefined && group === undefined && page === undefined,
      target = window;
    if (!src)
@@ -4751,7 +4752,7 @@
      page = this.env.current_page = 1;
      this.reset_qsearch();
    }
    else if (group != this.env.group)
    else if (!refresh && group != this.env.group)
      page = this.env.current_page = 1;
    if (this.env.search_id)
@@ -4889,6 +4890,9 @@
    if (action && (cid || action == 'add') && !this.drag_active) {
      if (this.env.group)
        url._gid = this.env.group;
      if (this.env.search_request)
        url._search = this.env.search_request;
      url._action = action;
      url._source = this.env.source;
@@ -5741,6 +5745,7 @@
    this.subscription_list = new rcube_treelist_widget(this.gui_objects.subscriptionlist, {
        selectable: true,
        tabexit: false,
        id_prefix: 'rcmli',
        id_encode: this.html_identifier_encode,
        id_decode: this.html_identifier_decode,
@@ -5858,8 +5863,9 @@
    row.attr({id: 'rcmli' + this.html_identifier_encode(id), 'class': class_name});
    if (!refrow || !refrow.length) {
      // remove old subfolders and toggle
      // remove old data, subfolders and toggle
      $('ul,div.treetoggle', row).remove();
      row.removeData('filtered');
    }
    // set folder name
@@ -5986,7 +5992,7 @@
      this.subscription_list.expand(this.folder_id2name(parent.id));
    }
    row = row.get(0);
    row = row.show().get(0);
    if (row.scrollIntoView)
      row.scrollIntoView();
@@ -6130,6 +6136,37 @@
    $('#folder-size').replaceWith(size);
  };
  // filter folders by namespace
  this.folder_filter = function(prefix)
  {
    this.subscription_list.reset_search();
    this.subscription_list.container.children('li').each(function() {
      var i, folder = ref.folder_id2name(this.id);
      // show all folders
      if (prefix == '---') {
      }
      // got namespace prefix
      else if (prefix) {
        if (folder !== prefix) {
          $(this).data('filtered', true).hide();
          return
        }
      }
      // no namespace prefix, filter out all other namespaces
      else {
        // first get all namespace roots
        for (i in ref.env.ns_roots) {
          if (folder === ref.env.ns_roots[i]) {
            $(this).data('filtered', true).hide();
            return;
          }
        }
      }
      $(this).removeData('filtered').show();
    });
  };
  /*********************************************************/
  /*********           GUI functionality           *********/