diff options
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/program/js/app.js b/program/js/app.js index c627983f4..71976096c 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -509,7 +509,7 @@ function rcube_webmail() return false; // let the browser handle this click (shift/ctrl usually opens the link in a new window/tab) - if ((obj && obj.href && String(obj.href).indexOf(location.href) < 0) && rcube_event.get_modifier(event)) { + if ((obj && obj.href && String(obj.href).indexOf('#') < 0) && rcube_event.get_modifier(event)) { return true; } @@ -820,7 +820,7 @@ function rcube_webmail() var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part; // open attachment in frame if it's of a supported mimetype - if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, $.map(this.env.mimetypes, function(v,k){ return v })) >= 0) { + if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes) >= 0) { if (props.mimetype == 'text/html') qstring += '&_safe=1'; this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); @@ -1090,6 +1090,12 @@ function rcube_webmail() } break; + case 'export-selected': + if (this.contact_list.rowcount > 0) { + this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _cid: this.contact_list.get_selection().join(',') }); + } + break; + case 'upload-photo': this.upload_contact_photo(props || this.gui_objects.uploadform); break; @@ -3037,7 +3043,7 @@ function rcube_webmail() ac_props; // close compose step in opener - if (window.opener && opener.rcmail && opener.rcmail.env.action == 'compose') { + if (window.opener && !window.opener.closed && opener.rcmail && opener.rcmail.env.action == 'compose') { setTimeout(function(){ opener.history.back(); }, 100); this.env.opened_extwin = true; } @@ -3707,9 +3713,10 @@ function rcube_webmail() { this.display_message(msg, type); - if (this.env.extwin && window.opener && opener.rcmail) { + if (this.env.extwin) { this.lock_form(this.gui_objects.messageform); - opener.rcmail.display_message(msg, type); + if (window.opener && !window.opener.closed && opener.rcmail) + opener.rcmail.display_message(msg, type); setTimeout(function(){ window.close() }, 1000); } else { @@ -4115,6 +4122,7 @@ function rcube_webmail() // thend we can enable the group-remove-selected command this.enable_command('group-remove-selected', this.env.group && list.selection.length > 0); this.enable_command('compose', this.env.group || list.selection.length > 0); + this.enable_command('export-selected', list.selection.length > 0); this.enable_command('edit', id && writable); this.enable_command('delete', list.selection.length && writable); @@ -4219,12 +4227,10 @@ function rcube_webmail() target = win; this.show_contentframe(true); - // load dummy content - if (!cid) { - // unselect selected row(s) + // load dummy content, unselect selected row(s) + if (!cid) this.contact_list.clear_selection(); - this.enable_command('delete', 'compose', false); - } + this.enable_command('delete', 'compose', 'export-selected', cid); } else if (framed) return false; @@ -6238,6 +6244,7 @@ function rcube_webmail() this.enable_command('compose', (uid && this.contact_list.rows[uid])); this.enable_command('delete', 'edit', writable); this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); + this.enable_command('export-selected', false); } case 'moveto': |