Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-07-28 20:25:01 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-07-28 21:13:41 +0300
commit32b3895f23316c3b862225d17008c7697e66093a (patch)
tree182d3d51f7474e4de158ee5986fc6ec1d7710da5
parent2e7eb897afbd5a82a25ef4c0703343c7dcbf88d8 (diff)
jump to next message faster when deleting the current one
-rw-r--r--js/views/messagesitem.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/js/views/messagesitem.js b/js/views/messagesitem.js
index a0c9bc393..e217a5871 100644
--- a/js/views/messagesitem.js
+++ b/js/views/messagesitem.js
@@ -92,24 +92,25 @@ define(function(require) {
var count = folder.get('total');
folder.set('total', count - 1);
+ var thisModelCollection = thisModel.collection;
+ var index = thisModelCollection.indexOf(thisModel);
+ var nextMessage = thisModelCollection.at(index - 1);
+ if (!nextMessage) {
+ nextMessage = thisModelCollection.at(index + 1);
+ }
+ if (require('state').currentMessageId === thisModel.id) {
+ if (nextMessage) {
+ var nextAccount = require('state').currentAccount;
+ var nextFolder = require('state').currentFolder;
+ Radio.message.trigger('load', nextAccount, nextFolder, nextMessage);
+ }
+ }
+
this.$el.addClass('transparency').slideUp(function() {
$('.tipsy').remove();
$('.tooltip').remove();
-
- var thisModelCollection = thisModel.collection;
- var index = thisModelCollection.indexOf(thisModel);
- var nextMessage = thisModelCollection.at(index - 1);
- if (!nextMessage) {
- nextMessage = thisModelCollection.at(index + 1);
- }
thisModelCollection.remove(thisModel);
- if (require('state').currentMessageId === thisModel.id) {
- if (nextMessage) {
- var account = require('state').currentAccount;
- var folder = require('state').currentFolder;
- Radio.message.trigger('load', account, folder, nextMessage);
- }
- }
+
// manually trigger mouseover event for current mouse position
// in order to create a tipsy for the next message if needed
if (event.clientX) {