1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

Review url/history

This commit is contained in:
Tankred Hase 2014-12-05 13:04:10 +01:00
parent 43eb385a14
commit dcfcd74373
2 changed files with 5 additions and 21 deletions

View File

@ -172,6 +172,10 @@ var MailListCtrl = function($scope, $timeout, $location, $filter, status, notifi
// sort message by uid
messages.sort(byUidDescending);
// Unselect message if it has been deleted from the messages array
if (messages.indexOf(currentMessage()) === -1) {
$scope.select();
}
// set display buffer to first messages
$scope.displayMessages = messages.slice(0, INIT_DISPLAY_LEN);
});
@ -285,7 +289,7 @@ var MailListCtrl = function($scope, $timeout, $location, $filter, status, notifi
// Notification API
//
(email || {}).onIncomingMessage = function(msgs) {
email.onIncomingMessage = function(msgs) {
var note, title, message, unreadMsgs;
unreadMsgs = msgs.filter(function(msg) {

View File

@ -26,26 +26,6 @@ if (!Function.prototype.bind) {
};
}
// a warm round of applause for phantomjs for missing events
(function() {
if (!window.CustomEvent) {
var CustomEvent = function(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
}
})();
//
// Test setup
//