Aleksander Machniak
2013-12-15 9a0153324eeb1f0e808cb1a063d1f37d49ad48e2
skins/larry/ui.js
@@ -369,8 +369,10 @@
  function body_mouseup(e)
  {
    var config, obj, target = e.target;
    if (target.className == 'inner')
        target = e.target.parentNode;
    for (var id in popups) {
      obj = popups[id];
      config = popupconfig[id];
@@ -379,9 +381,10 @@
        && !config.toggle
        && (!config.editable || !target_overlaps(target, obj.get(0)))
        && (!config.sticky || !rcube_mouse_is_over(e, obj.get(0)))
        && !$(target).is('.folder-selector-link')
      ) {
        var myid = id+'';
        window.setTimeout(function(){ show_popupmenu(myid, false) }, 10);
        window.setTimeout(function() { show_popupmenu(myid, false); }, 10);
      }
    }
  }
@@ -432,6 +435,9 @@
    // show a popup dialog on errors
    if (p.type == 'error' && rcmail.env.task != 'login') {
      // hide original message object, we don't want both
      rcmail.hide_message(p.object);
      if (me.message_timer) {
        window.clearTimeout(me.message_timer);
      }
@@ -440,8 +446,10 @@
      }
      var msg = p.message,
        pos = $(p.object).offset();
      pos.top -= (rcmail.env.task == 'login' ? 20 : 160);
        dialog_close = function() {
          // check if dialog is still displayed, to prevent from js error
          me.messagedialog.is(':visible') && me.messagedialog.dialog('destroy').hide();
        };
      if (me.messagedialog.is(':visible'))
        msg = me.messagedialog.html() + '<p>' + p.message + '</p>';
@@ -452,16 +460,14 @@
          closeOnEscape: true,
          dialogClass: 'popupmessage ' + p.type,
          title: env.errortitle,
          close: function() {
            me.messagedialog.dialog('destroy').hide();
          },
          position: ['center', pos.top],
          hide: { effect:'drop', direction:'right' },
          close: dialog_close,
          position: ['center', 'center'],
          hide: {effect: 'fadeOut'},
          width: 420,
          minHeight: 90
        }).show();
      me.message_timer = window.setTimeout(function(){ me.messagedialog.dialog('close'); }, Math.max(3000, p.timeout / 2));
      me.message_timer = window.setTimeout(dialog_close, p.timeout);
    }
  }