Thomas Bruederli
2015-03-15 ee9742c873d2b1436debe2aa2194a4f6a9253dc7
program/js/app.js
@@ -774,7 +774,7 @@
      case 'list':
        if (props && props != '') {
          this.reset_qsearch();
          this.reset_qsearch(true);
        }
        if (this.env.action == 'compose' && this.env.extwin) {
          window.close();
@@ -894,7 +894,7 @@
          else {
            // reload form
            if (props == 'reload') {
              form.action += '?_reload=1';
              form.action += '&_reload=1';
            }
            else if (this.task == 'settings' && (this.env.identities_level % 2) == 0  &&
              (input = $("input[name='_email']", form)) && input.length && !rcube_check_email(input.val())
@@ -1221,17 +1221,16 @@
      // reset quicksearch
      case 'reset-search':
        var n, s = this.env.search_request || this.env.qsearch,
            ss = this.gui_objects.qsearchbox && this.gui_objects.qsearchbox.value != '';
        var n, s = this.env.search_request || this.env.qsearch;
        this.reset_qsearch();
        this.reset_qsearch(true);
        this.select_all_mode = false;
        if (s && this.env.action == 'compose') {
          if (this.contact_list)
            this.list_contacts_clear();
        }
        else if (s && ss && this.env.mailbox) {
        else if (s && this.env.mailbox) {
          this.list_mailbox(this.env.mailbox, 1);
        }
        else if (s && this.task == 'addressbook') {
@@ -2420,12 +2419,7 @@
      this.env.current_page = page;
      this.env.search_scope = 'base';
      this.select_all_mode = false;
      // reset search filter
      this.filter_disabled = true;
      if (this.gui_objects.search_filter)
        $(this.gui_objects.search_filter).val('ALL').change();
      this.filter_disabled = false;
      this.reset_search_filter();
    }
    // also send search request to get the right messages
    else if (this.env.search_request)
@@ -3355,7 +3349,7 @@
    if (!this.gui_objects.messageform)
      return false;
    var i, pos, input_from = $("[name='_from']"),
    var i, elem, pos, input_from = $("[name='_from']"),
      input_to = $("[name='_to']"),
      input_subject = $("input[name='_subject']"),
      input_message = $("[name='_message']").get(0),
@@ -3409,11 +3403,14 @@
      this.compose_restore_dialog(0, html_mode)
    if (input_to.val() == '')
      input_to.focus();
      elem = input_to;
    else if (input_subject.val() == '')
      input_subject.focus();
      elem = input_subject;
    else if (input_message)
      input_message.focus();
      elem = input_message;
    // focus first empty element (need to be visible on IE8)
    $(elem).filter(':visible').focus();
    this.env.compose_focus_elem = document.activeElement;
@@ -4341,14 +4338,28 @@
    return url;
  };
  // reset search filter
  this.reset_search_filter = function()
  {
    this.filter_disabled = true;
    if (this.gui_objects.search_filter)
      $(this.gui_objects.search_filter).val('ALL').change();
    this.filter_disabled = false;
  };
  // reset quick-search form
  this.reset_qsearch = function()
  this.reset_qsearch = function(all)
  {
    if (this.gui_objects.qsearchbox)
      this.gui_objects.qsearchbox.value = '';
    if (this.env.qsearch)
      this.abort_request(this.env.qsearch);
    if (all) {
      this.env.search_scope = 'base';
      this.reset_search_filter();
    }
    this.env.qsearch = null;
    this.env.search_request = null;
@@ -6717,6 +6728,9 @@
    this.env.listcols = listcols;
    if (!this.env.coltypes)
      this.env.coltypes = {};
    // replace old column headers
    if (thead) {
      if (repl) {