mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
A new way to move in message list (message focused state).
Delete/Move optimizations. Display next message after deletion (Closes #120) Scrolling in message view (Closes #109)
This commit is contained in:
parent
a96e1d80c3
commit
0b30bac43f
17 changed files with 784 additions and 431 deletions
|
|
@ -11,10 +11,13 @@ function RainLoopApp()
|
|||
this.oData = null;
|
||||
this.oRemote = null;
|
||||
this.oCache = null;
|
||||
this.oMoveCache = {};
|
||||
|
||||
this.quotaDebounce = _.debounce(this.quota, 1000 * 30);
|
||||
this.moveOrDeleteResponseHelper = _.bind(this.moveOrDeleteResponseHelper, this);
|
||||
|
||||
this.messagesMoveTrigger = _.debounce(this.messagesMoveTrigger, 500);
|
||||
|
||||
window.setInterval(function () {
|
||||
RL.pub('interval.30s');
|
||||
}, 30000);
|
||||
|
|
@ -164,6 +167,57 @@ RainLoopApp.prototype.recacheInboxMessageList = function ()
|
|||
RL.remote().messageList(Utils.emptyFunction, 'INBOX', 0, RL.data().messagesPerPage(), '', true);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
{
|
||||
RL.reloadMessageList(bEmptyList);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveTrigger = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
_.each(this.oMoveCache, function (oItem) {
|
||||
RL.remote().messagesMove(self.moveOrDeleteResponseHelper, oItem['From'], oItem['To'], oItem['Uid']);
|
||||
});
|
||||
|
||||
this.oMoveCache = {};
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
||||
{
|
||||
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
|
||||
if (!this.oMoveCache[sH])
|
||||
{
|
||||
this.oMoveCache[sH] = {
|
||||
'From': sFromFolderFullNameRaw,
|
||||
'To': sToFolderFullNameRaw,
|
||||
'Uid': []
|
||||
};
|
||||
}
|
||||
|
||||
this.oMoveCache[sH]['Uid'] = _.union(this.oMoveCache[sH]['Uid'], aUidForMove);
|
||||
this.messagesMoveTrigger();
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
||||
{
|
||||
RL.remote().messagesCopy(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
sToFolderFullNameRaw,
|
||||
aUidForCopy
|
||||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
RL.remote().messagesDelete(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && RL.data().currentFolder())
|
||||
|
|
@ -183,7 +237,7 @@ RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
|||
}
|
||||
}
|
||||
|
||||
RL.reloadMessageList(0 === RL.data().messageList().length);
|
||||
RL.reloadMessageListHelper(0 === RL.data().messageList().length);
|
||||
RL.quotaDebounce();
|
||||
}
|
||||
};
|
||||
|
|
@ -194,12 +248,7 @@ RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
|||
*/
|
||||
RainLoopApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
RL.remote().messagesDelete(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
RL.data().removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
};
|
||||
|
||||
|
|
@ -255,25 +304,14 @@ RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFol
|
|||
{
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
|
||||
|
||||
RL.remote().messagesDelete(
|
||||
self.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
self.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
oData.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
|
||||
}]);
|
||||
}
|
||||
else if (oMoveFolder)
|
||||
{
|
||||
RL.remote().messagesMove(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
oMoveFolder.fullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
this.messagesMoveHelper(sFromFolderFullNameRaw, oMoveFolder.fullNameRaw, aUidForRemove);
|
||||
oData.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove, oMoveFolder.fullNameRaw);
|
||||
}
|
||||
};
|
||||
|
|
@ -295,14 +333,14 @@ RainLoopApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, a
|
|||
|
||||
if (oFromFolder && oToFolder)
|
||||
{
|
||||
bCopy = Utils.isUnd(bCopy) ? false : !!bCopy;
|
||||
|
||||
RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove'](
|
||||
this.moveOrDeleteResponseHelper,
|
||||
oFromFolder.fullNameRaw,
|
||||
oToFolder.fullNameRaw,
|
||||
aUidForMove
|
||||
);
|
||||
if (Utils.isUnd(bCopy) ? false : !!bCopy)
|
||||
{
|
||||
this.messagesCopyHelper(oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForMove);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.messagesMoveHelper(oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForMove);
|
||||
}
|
||||
|
||||
RL.data().removeMessagesFromList(oFromFolder.fullNameRaw, aUidForMove, oToFolder.fullNameRaw, bCopy);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ Enums.EventKeyCode = {
|
|||
'Down': 40,
|
||||
'End': 35,
|
||||
'Home': 36,
|
||||
'Space': 32,
|
||||
'Insert': 45,
|
||||
'Delete': 46,
|
||||
'A': 65,
|
||||
|
|
|
|||
|
|
@ -3,16 +3,35 @@
|
|||
/**
|
||||
* @constructor
|
||||
* @param {koProperty} oKoList
|
||||
* @param {koProperty} oKoFocusedItem
|
||||
* @param {koProperty} oKoSelectedItem
|
||||
* @param {string} sItemSelector
|
||||
* @param {string} sItemSelectedSelector
|
||||
* @param {string} sItemCheckedSelector
|
||||
* @param {string} sItemFocusedSelector
|
||||
*/
|
||||
function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector, sItemCheckedSelector)
|
||||
function Selector(oKoList, oKoFocusedItem, oKoSelectedItem,
|
||||
sItemSelector, sItemSelectedSelector, sItemCheckedSelector, sItemFocusedSelector)
|
||||
{
|
||||
this.list = oKoList;
|
||||
|
||||
this.focusedItem = oKoFocusedItem;
|
||||
this.selectedItem = oKoSelectedItem;
|
||||
|
||||
this.focusedItem.extend({'toggleSubscribe': [null,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
{
|
||||
oPrev.focused(false);
|
||||
}
|
||||
}, function (oNext) {
|
||||
if (oNext)
|
||||
{
|
||||
oNext.focused(true);
|
||||
}
|
||||
}
|
||||
]});
|
||||
|
||||
this.selectedItem.extend({'toggleSubscribe': [null,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
|
|
@ -33,29 +52,38 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
this.sItemSelector = sItemSelector;
|
||||
this.sItemSelectedSelector = sItemSelectedSelector;
|
||||
this.sItemCheckedSelector = sItemCheckedSelector;
|
||||
this.sItemFocusedSelector = sItemFocusedSelector;
|
||||
|
||||
this.sLastUid = '';
|
||||
this.oCallbacks = {};
|
||||
this.iSelectTimer = 0;
|
||||
|
||||
this.bUseKeyboard = true;
|
||||
this.bAutoSelect = true;
|
||||
|
||||
this.emptyFunction = function () {};
|
||||
|
||||
this.useItemSelectCallback = true;
|
||||
this.throttleSelection = false;
|
||||
|
||||
this.selectedItem.subscribe(function (oItem) {
|
||||
if (this.useItemSelectCallback)
|
||||
|
||||
if (oItem)
|
||||
{
|
||||
if (this.throttleSelection)
|
||||
{
|
||||
this.throttleSelection = false;
|
||||
this.selectItemCallbacksThrottle(oItem);
|
||||
this.sLastUid = this.getItemUid(oItem);
|
||||
this.focusedItem(oItem);
|
||||
}
|
||||
else
|
||||
|
||||
if (this.useItemSelectCallback)
|
||||
{
|
||||
this.selectItemCallbacks(oItem);
|
||||
}
|
||||
|
||||
}, this);
|
||||
|
||||
this.focusedItem.subscribe(function (oItem) {
|
||||
if (oItem)
|
||||
{
|
||||
this.sLastUid = this.getItemUid(oItem);
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
|
@ -87,25 +115,43 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
|
||||
this.useItemSelectCallback = false;
|
||||
|
||||
var
|
||||
self = this,
|
||||
iLen = 0,
|
||||
sFocusedUid = this.focusedItem() ? this.getItemUid(this.focusedItem()) : ''
|
||||
;
|
||||
|
||||
this.selectedItem(null);
|
||||
this.focusedItem(null);
|
||||
|
||||
if (Utils.isArray(aItems))
|
||||
{
|
||||
var self = this, iLen = aCheckedCache.length;
|
||||
iLen = aCheckedCache.length;
|
||||
|
||||
_.each(aItems, function (oItem) {
|
||||
if (0 < iLen && -1 < Utils.inArray(self.getItemUid(oItem), aCheckedCache))
|
||||
|
||||
var sUid = self.getItemUid(oItem);
|
||||
|
||||
if (0 < iLen && -1 < Utils.inArray(sUid, aCheckedCache))
|
||||
{
|
||||
oItem.checked(true);
|
||||
iLen--;
|
||||
}
|
||||
|
||||
if ('' !== sFocusedUid && sUid === sFocusedUid)
|
||||
{
|
||||
self.focusedItem(oItem);
|
||||
}
|
||||
|
||||
if (null !== mSelected && mSelected === self.getItemUid(oItem))
|
||||
{
|
||||
oItem.selected(true);
|
||||
mSelected = null;
|
||||
|
||||
if (!oItem.selected())
|
||||
{
|
||||
self.selectedItem(oItem);
|
||||
}
|
||||
|
||||
mSelected = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -113,6 +159,7 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
|
||||
aCheckedCache = [];
|
||||
mSelected = null;
|
||||
|
||||
}, this);
|
||||
|
||||
this.list.setSelectedByUid = function (sUid) {
|
||||
|
|
@ -185,14 +232,23 @@ Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeySco
|
|||
})
|
||||
;
|
||||
|
||||
key('space, enter', sKeyScope, function () {
|
||||
key('enter', sKeyScope, function () {
|
||||
if (!self.bAutoSelect)
|
||||
{
|
||||
if (self.focusedItem())
|
||||
{
|
||||
self.actionClick(self.focusedItem());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
key('up, shift+up, down, shift+down, insert, home, end, pageup, pagedown', sKeyScope, function (event, handler) {
|
||||
key('up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space', sKeyScope, function (event, handler) {
|
||||
if (event && handler && handler.shortcut)
|
||||
{
|
||||
var iKey = 0, aCodes = null;
|
||||
// TODO
|
||||
var iKey = 0;
|
||||
switch (handler.shortcut)
|
||||
{
|
||||
case 'up':
|
||||
|
|
@ -204,15 +260,22 @@ Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeySco
|
|||
iKey = Enums.EventKeyCode.Down;
|
||||
break;
|
||||
case 'insert':
|
||||
iKey = Enums.EventKeyCode.Insert;
|
||||
break;
|
||||
case 'space':
|
||||
iKey = Enums.EventKeyCode.Space;
|
||||
break;
|
||||
case 'home':
|
||||
iKey = Enums.EventKeyCode.Home;
|
||||
break;
|
||||
case 'end':
|
||||
iKey = Enums.EventKeyCode.End;
|
||||
break;
|
||||
case 'pageup':
|
||||
iKey = Enums.EventKeyCode.PageUp;
|
||||
break;
|
||||
case 'pagedown':
|
||||
aCodes = key.getPressedKeyCodes();
|
||||
if (aCodes && aCodes[0])
|
||||
{
|
||||
iKey = aCodes[0];
|
||||
}
|
||||
iKey = Enums.EventKeyCode.PageDown;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -250,6 +313,11 @@ Selector.prototype.useKeyboard = function (bValue)
|
|||
this.bUseKeyboard = !!bValue;
|
||||
};
|
||||
|
||||
Selector.prototype.autoSelect = function (bValue)
|
||||
{
|
||||
this.bAutoSelect = !!bValue;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} oItem
|
||||
* @returns {string}
|
||||
|
|
@ -284,14 +352,14 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
oResult = null,
|
||||
aList = this.list(),
|
||||
iListLen = aList ? aList.length : 0,
|
||||
oSelected = this.selectedItem()
|
||||
oFocused = this.focusedItem()
|
||||
;
|
||||
|
||||
if (0 < iListLen)
|
||||
{
|
||||
if (!oSelected)
|
||||
if (!oFocused)
|
||||
{
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Home === iEventKeyCode || Enums.EventKeyCode.PageUp === iEventKeyCode)
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode || Enums.EventKeyCode.Home === iEventKeyCode || Enums.EventKeyCode.PageUp === iEventKeyCode)
|
||||
{
|
||||
oResult = aList[0];
|
||||
}
|
||||
|
|
@ -300,16 +368,16 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
oResult = aList[aList.length - 1];
|
||||
}
|
||||
}
|
||||
else if (oSelected)
|
||||
else if (oFocused)
|
||||
{
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
_.each(aList, function (oItem) {
|
||||
if (!bStop)
|
||||
{
|
||||
switch (iEventKeyCode) {
|
||||
case Enums.EventKeyCode.Up:
|
||||
if (oSelected === oItem)
|
||||
if (oFocused === oItem)
|
||||
{
|
||||
bStop = true;
|
||||
}
|
||||
|
|
@ -320,12 +388,13 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
break;
|
||||
case Enums.EventKeyCode.Down:
|
||||
case Enums.EventKeyCode.Insert:
|
||||
case Enums.EventKeyCode.Space:
|
||||
if (bNext)
|
||||
{
|
||||
oResult = oItem;
|
||||
bStop = true;
|
||||
}
|
||||
else if (oSelected === oItem)
|
||||
else if (oFocused === oItem)
|
||||
{
|
||||
bNext = true;
|
||||
}
|
||||
|
|
@ -349,7 +418,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
{
|
||||
for (; iIndex < iListLen; iIndex++)
|
||||
{
|
||||
if (oSelected === aList[iIndex])
|
||||
if (oFocused === aList[iIndex])
|
||||
{
|
||||
iIndex += iPageStep;
|
||||
iIndex = iListLen - 1 < iIndex ? iListLen - 1 : iIndex;
|
||||
|
|
@ -362,7 +431,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
{
|
||||
for (iIndex = iListLen; iIndex >= 0; iIndex--)
|
||||
{
|
||||
if (oSelected === aList[iIndex])
|
||||
if (oFocused === aList[iIndex])
|
||||
{
|
||||
iIndex -= iPageStep;
|
||||
iIndex = 0 > iIndex ? 0 : iIndex;
|
||||
|
|
@ -376,53 +445,43 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
|
||||
if (oResult)
|
||||
{
|
||||
if (oSelected)
|
||||
if (oFocused)
|
||||
{
|
||||
if (bShiftKey)
|
||||
{
|
||||
if (Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Down === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
|
||||
this.throttleSelection = true;
|
||||
this.selectedItem(oResult);
|
||||
this.throttleSelection = true;
|
||||
this.focusedItem(oResult);
|
||||
|
||||
if (0 !== this.iSelectTimer)
|
||||
if (this.bAutoSelect && Enums.EventKeyCode.Space !== iEventKeyCode)
|
||||
{
|
||||
window.clearTimeout(this.iSelectTimer);
|
||||
this.iSelectTimer = window.setTimeout(function () {
|
||||
self.iSelectTimer = 0;
|
||||
self.actionClick(oResult);
|
||||
}, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iSelectTimer = window.setTimeout(function () {
|
||||
self.iSelectTimer = 0;
|
||||
}, 200);
|
||||
|
||||
this.actionClick(oResult);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
this.scrollToSelected();
|
||||
this.scrollToFocused();
|
||||
}
|
||||
else if (oSelected)
|
||||
else if (oFocused)
|
||||
{
|
||||
if (bShiftKey && (Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Down === iEventKeyCode))
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -430,7 +489,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
Selector.prototype.scrollToSelected = function ()
|
||||
Selector.prototype.scrollToFocused = function ()
|
||||
{
|
||||
if (!this.oContentVisible || !this.oContentScrollable)
|
||||
{
|
||||
|
|
@ -439,13 +498,13 @@ Selector.prototype.scrollToSelected = function ()
|
|||
|
||||
var
|
||||
iOffset = 20,
|
||||
oSelected = $(this.sItemSelectedSelector, this.oContentScrollable),
|
||||
oPos = oSelected.position(),
|
||||
oFocused = $(this.sItemFocusedSelector, this.oContentScrollable),
|
||||
oPos = oFocused.position(),
|
||||
iVisibleHeight = this.oContentVisible.height(),
|
||||
iSelectedHeight = oSelected.outerHeight()
|
||||
iFocusedHeight = oFocused.outerHeight()
|
||||
;
|
||||
|
||||
if (oPos && (oPos.top < 0 || oPos.top + iSelectedHeight > iVisibleHeight))
|
||||
if (oPos && (oPos.top < 0 || oPos.top + iFocusedHeight > iVisibleHeight))
|
||||
{
|
||||
if (oPos.top < 0)
|
||||
{
|
||||
|
|
@ -453,7 +512,7 @@ Selector.prototype.scrollToSelected = function ()
|
|||
}
|
||||
else
|
||||
{
|
||||
this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop() + oPos.top - iVisibleHeight + iSelectedHeight + iOffset);
|
||||
this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop() + oPos.top - iVisibleHeight + iFocusedHeight + iOffset);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -511,7 +570,6 @@ Selector.prototype.eventClickFunction = function (oItem, oEvent)
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} oItem
|
||||
* @param {Object=} oEvent
|
||||
*/
|
||||
|
|
@ -535,6 +593,7 @@ Selector.prototype.actionClick = function (oItem, oEvent)
|
|||
}
|
||||
|
||||
oItem.checked(!oItem.checked());
|
||||
|
||||
this.eventClickFunction(oItem, oEvent);
|
||||
}
|
||||
else if (oEvent.ctrlKey)
|
||||
|
|
@ -549,7 +608,6 @@ Selector.prototype.actionClick = function (oItem, oEvent)
|
|||
if (bClick)
|
||||
{
|
||||
this.selectedItem(oItem);
|
||||
this.sLastUid = sUid;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ WebMailAjaxRemoteStorage.prototype.messagesMove = function (fCallback, sFolder,
|
|||
'FromFolder': sFolder,
|
||||
'ToFolder': sToFolder,
|
||||
'Uids': aUids.join(',')
|
||||
}, null, '', ['MessageList', 'Message']);
|
||||
}, null, '', ['MessageList']);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -612,7 +612,7 @@ WebMailAjaxRemoteStorage.prototype.messagesDelete = function (fCallback, sFolder
|
|||
this.defaultRequest(fCallback, 'MessageDelete', {
|
||||
'Folder': sFolder,
|
||||
'Uids': aUids.join(',')
|
||||
}, null, '', ['MessageList', 'Message']);
|
||||
}, null, '', ['MessageList']);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ function WebMailDataStorage()
|
|||
}, this);
|
||||
|
||||
this.currentMessage = ko.observable(null);
|
||||
this.currentFocusedMessage = ko.observable(null);
|
||||
|
||||
this.message.subscribe(function (oMessage) {
|
||||
if (null === oMessage)
|
||||
|
|
@ -778,11 +779,15 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
iUnseenCount = 0,
|
||||
oData = RL.data(),
|
||||
oCache = RL.cache(),
|
||||
bMoveSelected = false,
|
||||
bGetNext = false,
|
||||
oNextMessage = null,
|
||||
aMessageList = oData.messageList(),
|
||||
oFromFolder = RL.cache().getFolderFromCacheList(sFromFolderFullNameRaw),
|
||||
oToFolder = '' === sToFolderFullNameRaw ? null : oCache.getFolderFromCacheList(sToFolderFullNameRaw || ''),
|
||||
sCurrentFolderFullNameRaw = oData.currentFolderFullNameRaw(),
|
||||
oCurrentMessage = oData.message(),
|
||||
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(oData.messageList(), function (oMessage) {
|
||||
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(aMessageList, function (oMessage) {
|
||||
return oMessage && -1 < Utils.inArray(Utils.pInt(oMessage.uid), aUidForRemove);
|
||||
}) : []
|
||||
;
|
||||
|
|
@ -792,6 +797,11 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
{
|
||||
iUnseenCount++;
|
||||
}
|
||||
|
||||
if (oMessage.selected())
|
||||
{
|
||||
bMoveSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (oFromFolder && !bCopy)
|
||||
|
|
@ -827,10 +837,33 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
}
|
||||
else
|
||||
{
|
||||
// select next message
|
||||
if (bMoveSelected)
|
||||
{
|
||||
_.each(aMessageList, function (oMessage) {
|
||||
if (!oNextMessage && oMessage)
|
||||
{
|
||||
if (bGetNext && !oMessage.checked() && !oMessage.deleted() && !oMessage.selected())
|
||||
{
|
||||
oNextMessage = oMessage;
|
||||
}
|
||||
else if (!bGetNext && oMessage.selected())
|
||||
{
|
||||
bGetNext = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (oNextMessage)
|
||||
{
|
||||
this.currentMessage(oNextMessage);
|
||||
}
|
||||
}
|
||||
|
||||
oData.messageListIsNotCompleted(true);
|
||||
|
||||
_.each(aMessages, function (oMessage) {
|
||||
if (oCurrentMessage && oCurrentMessage.requestHash === oMessage.requestHash)
|
||||
if (oCurrentMessage && oCurrentMessage.hash === oMessage.hash)
|
||||
{
|
||||
oCurrentMessage = null;
|
||||
oData.message(null);
|
||||
|
|
|
|||
|
|
@ -161,6 +161,10 @@
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: #aaa;
|
||||
}
|
||||
|
||||
&.deleted {
|
||||
max-height: 0px;
|
||||
border-color: transparent !important;
|
||||
|
|
@ -213,15 +217,24 @@
|
|||
.sidebarParent {
|
||||
background-color: #69A8F5;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#69A8F5, 5%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.selected {
|
||||
|
||||
background-color: #fff;
|
||||
z-index: 102;
|
||||
|
||||
.sidebarParent {
|
||||
background-color: #398CF2;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#398CF2, 5%) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,6 +229,10 @@ html.rl-no-preview-pane {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: #aaa !important;
|
||||
}
|
||||
|
||||
&.e-single-line {
|
||||
height: 35px;
|
||||
}
|
||||
|
|
@ -409,6 +413,10 @@ html.rl-no-preview-pane {
|
|||
.sidebarParent {
|
||||
background-color: orange;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(orange, 10%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.hasUnseenSubMessage {
|
||||
|
|
@ -416,6 +424,9 @@ html.rl-no-preview-pane {
|
|||
.sidebarParent {
|
||||
background-color: lighten(orange, 30%);
|
||||
}
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(orange, 10%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.hasParentMessage {
|
||||
|
|
@ -425,11 +436,20 @@ html.rl-no-preview-pane {
|
|||
background-color: #bdc3c7;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#bdc3c7, 10%) !important;
|
||||
}
|
||||
|
||||
&.unseen {
|
||||
background-color: darken(#ecf0f1, 5%);
|
||||
|
||||
.sidebarParent {
|
||||
background-color: darken(#bdc3c7, 30%);
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#bdc3c7, 40%) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -437,6 +457,10 @@ html.rl-no-preview-pane {
|
|||
.sidebarParent {
|
||||
background-color: lighten(#398CF2, 10%) !important;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#398CF2, 5%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.selected {
|
||||
|
|
@ -447,6 +471,10 @@ html.rl-no-preview-pane {
|
|||
background-color: #398CF2 !important;
|
||||
}
|
||||
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(#398CF2, 5%) !important;
|
||||
}
|
||||
|
||||
.delimiter {
|
||||
background-color: #398CF2;
|
||||
.opacity(20);
|
||||
|
|
@ -483,7 +511,7 @@ html.rl-no-preview-pane {
|
|||
background-color: #000;
|
||||
}
|
||||
.b-content {
|
||||
.opacity(98);
|
||||
.opacity(97);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ function MailBoxMessageListViewModel()
|
|||
this.message = oData.message;
|
||||
this.messageList = oData.messageList;
|
||||
this.currentMessage = oData.currentMessage;
|
||||
this.currentFocusedMessage = oData.currentFocusedMessage;
|
||||
this.isMessageSelected = oData.isMessageSelected;
|
||||
this.messageListSearch = oData.messageListSearch;
|
||||
this.messageListError = oData.messageListError;
|
||||
|
|
@ -191,8 +192,9 @@ function MailBoxMessageListViewModel()
|
|||
|
||||
this.quotaTooltip = _.bind(this.quotaTooltip, this);
|
||||
|
||||
this.selector = new Selector(this.messageList, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage');
|
||||
this.selector = new Selector(this.messageList, this.currentFocusedMessage, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage',
|
||||
'.messageListItem.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oMessage) {
|
||||
if (oMessage)
|
||||
|
|
@ -215,6 +217,13 @@ function MailBoxMessageListViewModel()
|
|||
return oMessage ? oMessage.generateUid() : '';
|
||||
});
|
||||
|
||||
// this.selector.autoSelect(false);
|
||||
oData.layout.subscribe(function (mValue) {
|
||||
this.selector.autoSelect(Enums.Layout.NoPreview !== mValue);
|
||||
}, this);
|
||||
|
||||
oData.layout.valueHasMutated();
|
||||
|
||||
RL
|
||||
.sub('mailbox.message-list.selector.go-down', function () {
|
||||
this.selector.goDown();
|
||||
|
|
@ -687,7 +696,7 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
|
|||
});
|
||||
|
||||
// change focused state
|
||||
key('tab, enter', Enums.KeyState.MessageList, function () {
|
||||
key('tab', Enums.KeyState.MessageList, function () {
|
||||
if (oData.useKeyboardShortcuts())
|
||||
{
|
||||
if (self.message())
|
||||
|
|
|
|||
|
|
@ -385,12 +385,11 @@ MailBoxMessageViewViewModel.prototype.escShortcuts = function ()
|
|||
else
|
||||
{
|
||||
this.message.focused(false);
|
||||
}
|
||||
|
||||
if (Enums.Layout.NoPreview === RL.data().layout())
|
||||
{
|
||||
RL.historyBack();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -493,7 +492,6 @@ MailBoxMessageViewViewModel.prototype.initShortcuts = function ()
|
|||
key('delete, shift+delete', Enums.KeyState.MessageView, function (event, handler) {
|
||||
if (oData.useKeyboardShortcuts() && event)
|
||||
{
|
||||
self.deleteCommand();
|
||||
if (handler && 'shift+delete' === handler.shortcut)
|
||||
{
|
||||
self.deleteWithoutMoveCommand();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ function PopupsContactsViewModel()
|
|||
this.contacts = ko.observableArray([]);
|
||||
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
||||
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
||||
|
||||
this.currentContact = ko.observable(null);
|
||||
this.currentFocusedContact = ko.observable(null);
|
||||
|
||||
this.importUploaderButton = ko.observable(null);
|
||||
|
||||
|
|
@ -160,8 +162,9 @@ function PopupsContactsViewModel()
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.selector = new Selector(this.contacts, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem');
|
||||
this.selector = new Selector(this.contacts, this.currentFocusedContact, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem',
|
||||
'.e-contact-item.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oContact) {
|
||||
this.populateViewContact(oContact ? oContact : null);
|
||||
|
|
|
|||
|
|
@ -6843,6 +6843,9 @@ html.rl-no-preview-pane .messageList.message-selected {
|
|||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
.messageList .b-content .messageListItem.focused .sidebarParent {
|
||||
background-color: #aaa !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.e-single-line {
|
||||
height: 35px;
|
||||
}
|
||||
|
|
@ -6999,27 +7002,42 @@ html.rl-no-preview-pane .messageList.message-selected {
|
|||
.messageList .b-content .messageListItem.unseen .sidebarParent {
|
||||
background-color: orange;
|
||||
}
|
||||
.messageList .b-content .messageListItem.unseen.focused .sidebarParent {
|
||||
background-color: #cc8400 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasUnseenSubMessage {
|
||||
background-color: #FFFFD9;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasUnseenSubMessage .sidebarParent {
|
||||
background-color: #ffdb99;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasUnseenSubMessage.focused .sidebarParent {
|
||||
background-color: #cc8400 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage {
|
||||
background-color: #ecf0f1;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage .sidebarParent {
|
||||
background-color: #bdc3c7;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage.focused .sidebarParent {
|
||||
background-color: #a1aab0 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage.unseen {
|
||||
background-color: #dde4e6;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage.unseen .sidebarParent {
|
||||
background-color: #6c777f;
|
||||
}
|
||||
.messageList .b-content .messageListItem.hasParentMessage.unseen.focused .sidebarParent {
|
||||
background-color: #545e64 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.checked .sidebarParent {
|
||||
background-color: #69a8f5 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.checked.focused .sidebarParent {
|
||||
background-color: #217ef0 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.selected {
|
||||
background-color: #DFEFFF;
|
||||
z-index: 102;
|
||||
|
|
@ -7027,6 +7045,9 @@ html.rl-no-preview-pane .messageList.message-selected {
|
|||
.messageList .b-content .messageListItem.selected .sidebarParent {
|
||||
background-color: #398CF2 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.selected.focused .sidebarParent {
|
||||
background-color: #217ef0 !important;
|
||||
}
|
||||
.messageList .b-content .messageListItem.selected .delimiter {
|
||||
background-color: #398CF2;
|
||||
opacity: 0.2;
|
||||
|
|
@ -7055,8 +7076,8 @@ html.rl-no-preview-pane .messageList.message-selected {
|
|||
background-color: #000;
|
||||
}
|
||||
.messageList.message-focused .b-content {
|
||||
opacity: 0.98;
|
||||
filter: alpha(opacity=98);
|
||||
opacity: 0.97;
|
||||
filter: alpha(opacity=97);
|
||||
}
|
||||
.messageList.hideMessageListCheckbox .checkedParent,
|
||||
.messageList.hideMessageListCheckbox .checkboxCkeckAll {
|
||||
|
|
@ -7595,6 +7616,9 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
.b-contacts-content.modal .b-list-content .e-contact-item.focused .sidebarParent {
|
||||
background-color: #aaa;
|
||||
}
|
||||
.b-contacts-content.modal .b-list-content .e-contact-item.deleted {
|
||||
max-height: 0px;
|
||||
border-color: transparent !important;
|
||||
|
|
@ -7641,6 +7665,9 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
.b-contacts-content.modal .b-list-content .e-contact-item.checked .sidebarParent {
|
||||
background-color: #69A8F5;
|
||||
}
|
||||
.b-contacts-content.modal .b-list-content .e-contact-item.checked.focused .sidebarParent {
|
||||
background-color: #519af3 !important;
|
||||
}
|
||||
.b-contacts-content.modal .b-list-content .e-contact-item.selected {
|
||||
background-color: #fff;
|
||||
z-index: 102;
|
||||
|
|
@ -7648,6 +7675,9 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
.b-contacts-content.modal .b-list-content .e-contact-item.selected .sidebarParent {
|
||||
background-color: #398CF2;
|
||||
}
|
||||
.b-contacts-content.modal .b-list-content .e-contact-item.selected.focused .sidebarParent {
|
||||
background-color: #217ef0 !important;
|
||||
}
|
||||
.b-contacts-content.modal .b-view-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
|
|||
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -477,6 +477,7 @@ Enums.EventKeyCode = {
|
|||
'Down': 40,
|
||||
'End': 35,
|
||||
'Home': 36,
|
||||
'Space': 32,
|
||||
'Insert': 45,
|
||||
'Delete': 46,
|
||||
'A': 65,
|
||||
|
|
|
|||
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -481,6 +481,7 @@ Enums.EventKeyCode = {
|
|||
'Down': 40,
|
||||
'End': 35,
|
||||
'Home': 36,
|
||||
'Space': 32,
|
||||
'Insert': 45,
|
||||
'Delete': 46,
|
||||
'A': 65,
|
||||
|
|
@ -3886,16 +3887,35 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
|
|||
/**
|
||||
* @constructor
|
||||
* @param {koProperty} oKoList
|
||||
* @param {koProperty} oKoFocusedItem
|
||||
* @param {koProperty} oKoSelectedItem
|
||||
* @param {string} sItemSelector
|
||||
* @param {string} sItemSelectedSelector
|
||||
* @param {string} sItemCheckedSelector
|
||||
* @param {string} sItemFocusedSelector
|
||||
*/
|
||||
function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector, sItemCheckedSelector)
|
||||
function Selector(oKoList, oKoFocusedItem, oKoSelectedItem,
|
||||
sItemSelector, sItemSelectedSelector, sItemCheckedSelector, sItemFocusedSelector)
|
||||
{
|
||||
this.list = oKoList;
|
||||
|
||||
this.focusedItem = oKoFocusedItem;
|
||||
this.selectedItem = oKoSelectedItem;
|
||||
|
||||
this.focusedItem.extend({'toggleSubscribe': [null,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
{
|
||||
oPrev.focused(false);
|
||||
}
|
||||
}, function (oNext) {
|
||||
if (oNext)
|
||||
{
|
||||
oNext.focused(true);
|
||||
}
|
||||
}
|
||||
]});
|
||||
|
||||
this.selectedItem.extend({'toggleSubscribe': [null,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
|
|
@ -3916,29 +3936,38 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
this.sItemSelector = sItemSelector;
|
||||
this.sItemSelectedSelector = sItemSelectedSelector;
|
||||
this.sItemCheckedSelector = sItemCheckedSelector;
|
||||
this.sItemFocusedSelector = sItemFocusedSelector;
|
||||
|
||||
this.sLastUid = '';
|
||||
this.oCallbacks = {};
|
||||
this.iSelectTimer = 0;
|
||||
|
||||
this.bUseKeyboard = true;
|
||||
this.bAutoSelect = true;
|
||||
|
||||
this.emptyFunction = function () {};
|
||||
|
||||
this.useItemSelectCallback = true;
|
||||
this.throttleSelection = false;
|
||||
|
||||
this.selectedItem.subscribe(function (oItem) {
|
||||
if (this.useItemSelectCallback)
|
||||
|
||||
if (oItem)
|
||||
{
|
||||
if (this.throttleSelection)
|
||||
{
|
||||
this.throttleSelection = false;
|
||||
this.selectItemCallbacksThrottle(oItem);
|
||||
this.sLastUid = this.getItemUid(oItem);
|
||||
this.focusedItem(oItem);
|
||||
}
|
||||
else
|
||||
|
||||
if (this.useItemSelectCallback)
|
||||
{
|
||||
this.selectItemCallbacks(oItem);
|
||||
}
|
||||
|
||||
}, this);
|
||||
|
||||
this.focusedItem.subscribe(function (oItem) {
|
||||
if (oItem)
|
||||
{
|
||||
this.sLastUid = this.getItemUid(oItem);
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
|
@ -3970,25 +3999,43 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
|
||||
this.useItemSelectCallback = false;
|
||||
|
||||
var
|
||||
self = this,
|
||||
iLen = 0,
|
||||
sFocusedUid = this.focusedItem() ? this.getItemUid(this.focusedItem()) : ''
|
||||
;
|
||||
|
||||
this.selectedItem(null);
|
||||
this.focusedItem(null);
|
||||
|
||||
if (Utils.isArray(aItems))
|
||||
{
|
||||
var self = this, iLen = aCheckedCache.length;
|
||||
iLen = aCheckedCache.length;
|
||||
|
||||
_.each(aItems, function (oItem) {
|
||||
if (0 < iLen && -1 < Utils.inArray(self.getItemUid(oItem), aCheckedCache))
|
||||
|
||||
var sUid = self.getItemUid(oItem);
|
||||
|
||||
if (0 < iLen && -1 < Utils.inArray(sUid, aCheckedCache))
|
||||
{
|
||||
oItem.checked(true);
|
||||
iLen--;
|
||||
}
|
||||
|
||||
if ('' !== sFocusedUid && sUid === sFocusedUid)
|
||||
{
|
||||
self.focusedItem(oItem);
|
||||
}
|
||||
|
||||
if (null !== mSelected && mSelected === self.getItemUid(oItem))
|
||||
{
|
||||
oItem.selected(true);
|
||||
mSelected = null;
|
||||
|
||||
if (!oItem.selected())
|
||||
{
|
||||
self.selectedItem(oItem);
|
||||
}
|
||||
|
||||
mSelected = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -3996,6 +4043,7 @@ function Selector(oKoList, oKoSelectedItem, sItemSelector, sItemSelectedSelector
|
|||
|
||||
aCheckedCache = [];
|
||||
mSelected = null;
|
||||
|
||||
}, this);
|
||||
|
||||
this.list.setSelectedByUid = function (sUid) {
|
||||
|
|
@ -4068,14 +4116,23 @@ Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeySco
|
|||
})
|
||||
;
|
||||
|
||||
key('space, enter', sKeyScope, function () {
|
||||
key('enter', sKeyScope, function () {
|
||||
if (!self.bAutoSelect)
|
||||
{
|
||||
if (self.focusedItem())
|
||||
{
|
||||
self.actionClick(self.focusedItem());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
key('up, shift+up, down, shift+down, insert, home, end, pageup, pagedown', sKeyScope, function (event, handler) {
|
||||
key('up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space', sKeyScope, function (event, handler) {
|
||||
if (event && handler && handler.shortcut)
|
||||
{
|
||||
var iKey = 0, aCodes = null;
|
||||
// TODO
|
||||
var iKey = 0;
|
||||
switch (handler.shortcut)
|
||||
{
|
||||
case 'up':
|
||||
|
|
@ -4087,15 +4144,22 @@ Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeySco
|
|||
iKey = Enums.EventKeyCode.Down;
|
||||
break;
|
||||
case 'insert':
|
||||
iKey = Enums.EventKeyCode.Insert;
|
||||
break;
|
||||
case 'space':
|
||||
iKey = Enums.EventKeyCode.Space;
|
||||
break;
|
||||
case 'home':
|
||||
iKey = Enums.EventKeyCode.Home;
|
||||
break;
|
||||
case 'end':
|
||||
iKey = Enums.EventKeyCode.End;
|
||||
break;
|
||||
case 'pageup':
|
||||
iKey = Enums.EventKeyCode.PageUp;
|
||||
break;
|
||||
case 'pagedown':
|
||||
aCodes = key.getPressedKeyCodes();
|
||||
if (aCodes && aCodes[0])
|
||||
{
|
||||
iKey = aCodes[0];
|
||||
}
|
||||
iKey = Enums.EventKeyCode.PageDown;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -4133,6 +4197,11 @@ Selector.prototype.useKeyboard = function (bValue)
|
|||
this.bUseKeyboard = !!bValue;
|
||||
};
|
||||
|
||||
Selector.prototype.autoSelect = function (bValue)
|
||||
{
|
||||
this.bAutoSelect = !!bValue;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} oItem
|
||||
* @returns {string}
|
||||
|
|
@ -4167,14 +4236,14 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
oResult = null,
|
||||
aList = this.list(),
|
||||
iListLen = aList ? aList.length : 0,
|
||||
oSelected = this.selectedItem()
|
||||
oFocused = this.focusedItem()
|
||||
;
|
||||
|
||||
if (0 < iListLen)
|
||||
{
|
||||
if (!oSelected)
|
||||
if (!oFocused)
|
||||
{
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Home === iEventKeyCode || Enums.EventKeyCode.PageUp === iEventKeyCode)
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode || Enums.EventKeyCode.Home === iEventKeyCode || Enums.EventKeyCode.PageUp === iEventKeyCode)
|
||||
{
|
||||
oResult = aList[0];
|
||||
}
|
||||
|
|
@ -4183,16 +4252,16 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
oResult = aList[aList.length - 1];
|
||||
}
|
||||
}
|
||||
else if (oSelected)
|
||||
else if (oFocused)
|
||||
{
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
if (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
_.each(aList, function (oItem) {
|
||||
if (!bStop)
|
||||
{
|
||||
switch (iEventKeyCode) {
|
||||
case Enums.EventKeyCode.Up:
|
||||
if (oSelected === oItem)
|
||||
if (oFocused === oItem)
|
||||
{
|
||||
bStop = true;
|
||||
}
|
||||
|
|
@ -4203,12 +4272,13 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
break;
|
||||
case Enums.EventKeyCode.Down:
|
||||
case Enums.EventKeyCode.Insert:
|
||||
case Enums.EventKeyCode.Space:
|
||||
if (bNext)
|
||||
{
|
||||
oResult = oItem;
|
||||
bStop = true;
|
||||
}
|
||||
else if (oSelected === oItem)
|
||||
else if (oFocused === oItem)
|
||||
{
|
||||
bNext = true;
|
||||
}
|
||||
|
|
@ -4232,7 +4302,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
{
|
||||
for (; iIndex < iListLen; iIndex++)
|
||||
{
|
||||
if (oSelected === aList[iIndex])
|
||||
if (oFocused === aList[iIndex])
|
||||
{
|
||||
iIndex += iPageStep;
|
||||
iIndex = iListLen - 1 < iIndex ? iListLen - 1 : iIndex;
|
||||
|
|
@ -4245,7 +4315,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
{
|
||||
for (iIndex = iListLen; iIndex >= 0; iIndex--)
|
||||
{
|
||||
if (oSelected === aList[iIndex])
|
||||
if (oFocused === aList[iIndex])
|
||||
{
|
||||
iIndex -= iPageStep;
|
||||
iIndex = 0 > iIndex ? 0 : iIndex;
|
||||
|
|
@ -4259,53 +4329,43 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
|
||||
if (oResult)
|
||||
{
|
||||
if (oSelected)
|
||||
if (oFocused)
|
||||
{
|
||||
if (bShiftKey)
|
||||
{
|
||||
if (Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Down === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
|
||||
this.throttleSelection = true;
|
||||
this.selectedItem(oResult);
|
||||
this.throttleSelection = true;
|
||||
this.focusedItem(oResult);
|
||||
|
||||
if (0 !== this.iSelectTimer)
|
||||
if (this.bAutoSelect && Enums.EventKeyCode.Space !== iEventKeyCode)
|
||||
{
|
||||
window.clearTimeout(this.iSelectTimer);
|
||||
this.iSelectTimer = window.setTimeout(function () {
|
||||
self.iSelectTimer = 0;
|
||||
self.actionClick(oResult);
|
||||
}, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iSelectTimer = window.setTimeout(function () {
|
||||
self.iSelectTimer = 0;
|
||||
}, 200);
|
||||
|
||||
this.actionClick(oResult);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
this.scrollToSelected();
|
||||
this.scrollToFocused();
|
||||
}
|
||||
else if (oSelected)
|
||||
else if (oFocused)
|
||||
{
|
||||
if (bShiftKey && (Enums.EventKeyCode.Up === iEventKeyCode || Enums.EventKeyCode.Down === iEventKeyCode))
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode)
|
||||
else if (Enums.EventKeyCode.Insert === iEventKeyCode || Enums.EventKeyCode.Space === iEventKeyCode)
|
||||
{
|
||||
oSelected.checked(!oSelected.checked());
|
||||
oFocused.checked(!oFocused.checked());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -4313,7 +4373,7 @@ Selector.prototype.newSelectPosition = function (iEventKeyCode, bShiftKey)
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
Selector.prototype.scrollToSelected = function ()
|
||||
Selector.prototype.scrollToFocused = function ()
|
||||
{
|
||||
if (!this.oContentVisible || !this.oContentScrollable)
|
||||
{
|
||||
|
|
@ -4322,13 +4382,13 @@ Selector.prototype.scrollToSelected = function ()
|
|||
|
||||
var
|
||||
iOffset = 20,
|
||||
oSelected = $(this.sItemSelectedSelector, this.oContentScrollable),
|
||||
oPos = oSelected.position(),
|
||||
oFocused = $(this.sItemFocusedSelector, this.oContentScrollable),
|
||||
oPos = oFocused.position(),
|
||||
iVisibleHeight = this.oContentVisible.height(),
|
||||
iSelectedHeight = oSelected.outerHeight()
|
||||
iFocusedHeight = oFocused.outerHeight()
|
||||
;
|
||||
|
||||
if (oPos && (oPos.top < 0 || oPos.top + iSelectedHeight > iVisibleHeight))
|
||||
if (oPos && (oPos.top < 0 || oPos.top + iFocusedHeight > iVisibleHeight))
|
||||
{
|
||||
if (oPos.top < 0)
|
||||
{
|
||||
|
|
@ -4336,7 +4396,7 @@ Selector.prototype.scrollToSelected = function ()
|
|||
}
|
||||
else
|
||||
{
|
||||
this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop() + oPos.top - iVisibleHeight + iSelectedHeight + iOffset);
|
||||
this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop() + oPos.top - iVisibleHeight + iFocusedHeight + iOffset);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -4394,7 +4454,6 @@ Selector.prototype.eventClickFunction = function (oItem, oEvent)
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object} oItem
|
||||
* @param {Object=} oEvent
|
||||
*/
|
||||
|
|
@ -4418,6 +4477,7 @@ Selector.prototype.actionClick = function (oItem, oEvent)
|
|||
}
|
||||
|
||||
oItem.checked(!oItem.checked());
|
||||
|
||||
this.eventClickFunction(oItem, oEvent);
|
||||
}
|
||||
else if (oEvent.ctrlKey)
|
||||
|
|
@ -4432,7 +4492,6 @@ Selector.prototype.actionClick = function (oItem, oEvent)
|
|||
if (bClick)
|
||||
{
|
||||
this.selectedItem(oItem);
|
||||
this.sLastUid = sUid;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -9524,7 +9583,9 @@ function PopupsContactsViewModel()
|
|||
this.contacts = ko.observableArray([]);
|
||||
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
||||
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
||||
|
||||
this.currentContact = ko.observable(null);
|
||||
this.currentFocusedContact = ko.observable(null);
|
||||
|
||||
this.importUploaderButton = ko.observable(null);
|
||||
|
||||
|
|
@ -9651,8 +9712,9 @@ function PopupsContactsViewModel()
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.selector = new Selector(this.contacts, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem');
|
||||
this.selector = new Selector(this.contacts, this.currentFocusedContact, this.currentContact,
|
||||
'.e-contact-item .actionHandle', '.e-contact-item.selected', '.e-contact-item .checkboxItem',
|
||||
'.e-contact-item.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oContact) {
|
||||
this.populateViewContact(oContact ? oContact : null);
|
||||
|
|
@ -11685,6 +11747,7 @@ function MailBoxMessageListViewModel()
|
|||
this.message = oData.message;
|
||||
this.messageList = oData.messageList;
|
||||
this.currentMessage = oData.currentMessage;
|
||||
this.currentFocusedMessage = oData.currentFocusedMessage;
|
||||
this.isMessageSelected = oData.isMessageSelected;
|
||||
this.messageListSearch = oData.messageListSearch;
|
||||
this.messageListError = oData.messageListError;
|
||||
|
|
@ -11857,8 +11920,9 @@ function MailBoxMessageListViewModel()
|
|||
|
||||
this.quotaTooltip = _.bind(this.quotaTooltip, this);
|
||||
|
||||
this.selector = new Selector(this.messageList, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage');
|
||||
this.selector = new Selector(this.messageList, this.currentFocusedMessage, this.currentMessage,
|
||||
'.messageListItem .actionHandle', '.messageListItem.selected', '.messageListItem .checkboxMessage',
|
||||
'.messageListItem.focused');
|
||||
|
||||
this.selector.on('onItemSelect', _.bind(function (oMessage) {
|
||||
if (oMessage)
|
||||
|
|
@ -11881,6 +11945,13 @@ function MailBoxMessageListViewModel()
|
|||
return oMessage ? oMessage.generateUid() : '';
|
||||
});
|
||||
|
||||
// this.selector.autoSelect(false);
|
||||
oData.layout.subscribe(function (mValue) {
|
||||
this.selector.autoSelect(Enums.Layout.NoPreview !== mValue);
|
||||
}, this);
|
||||
|
||||
oData.layout.valueHasMutated();
|
||||
|
||||
RL
|
||||
.sub('mailbox.message-list.selector.go-down', function () {
|
||||
this.selector.goDown();
|
||||
|
|
@ -12353,7 +12424,7 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
|
|||
});
|
||||
|
||||
// change focused state
|
||||
key('tab, enter', Enums.KeyState.MessageList, function () {
|
||||
key('tab', Enums.KeyState.MessageList, function () {
|
||||
if (oData.useKeyboardShortcuts())
|
||||
{
|
||||
if (self.message())
|
||||
|
|
@ -12873,12 +12944,11 @@ MailBoxMessageViewViewModel.prototype.escShortcuts = function ()
|
|||
else
|
||||
{
|
||||
this.message.focused(false);
|
||||
}
|
||||
|
||||
if (Enums.Layout.NoPreview === RL.data().layout())
|
||||
{
|
||||
RL.historyBack();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -12981,7 +13051,6 @@ MailBoxMessageViewViewModel.prototype.initShortcuts = function ()
|
|||
key('delete, shift+delete', Enums.KeyState.MessageView, function (event, handler) {
|
||||
if (oData.useKeyboardShortcuts() && event)
|
||||
{
|
||||
self.deleteCommand();
|
||||
if (handler && 'shift+delete' === handler.shortcut)
|
||||
{
|
||||
self.deleteWithoutMoveCommand();
|
||||
|
|
@ -14855,6 +14924,7 @@ function WebMailDataStorage()
|
|||
}, this);
|
||||
|
||||
this.currentMessage = ko.observable(null);
|
||||
this.currentFocusedMessage = ko.observable(null);
|
||||
|
||||
this.message.subscribe(function (oMessage) {
|
||||
if (null === oMessage)
|
||||
|
|
@ -15336,11 +15406,15 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
iUnseenCount = 0,
|
||||
oData = RL.data(),
|
||||
oCache = RL.cache(),
|
||||
bMoveSelected = false,
|
||||
bGetNext = false,
|
||||
oNextMessage = null,
|
||||
aMessageList = oData.messageList(),
|
||||
oFromFolder = RL.cache().getFolderFromCacheList(sFromFolderFullNameRaw),
|
||||
oToFolder = '' === sToFolderFullNameRaw ? null : oCache.getFolderFromCacheList(sToFolderFullNameRaw || ''),
|
||||
sCurrentFolderFullNameRaw = oData.currentFolderFullNameRaw(),
|
||||
oCurrentMessage = oData.message(),
|
||||
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(oData.messageList(), function (oMessage) {
|
||||
aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(aMessageList, function (oMessage) {
|
||||
return oMessage && -1 < Utils.inArray(Utils.pInt(oMessage.uid), aUidForRemove);
|
||||
}) : []
|
||||
;
|
||||
|
|
@ -15350,6 +15424,11 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
{
|
||||
iUnseenCount++;
|
||||
}
|
||||
|
||||
if (oMessage.selected())
|
||||
{
|
||||
bMoveSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (oFromFolder && !bCopy)
|
||||
|
|
@ -15385,10 +15464,33 @@ WebMailDataStorage.prototype.removeMessagesFromList = function (
|
|||
}
|
||||
else
|
||||
{
|
||||
// select next message
|
||||
if (bMoveSelected)
|
||||
{
|
||||
_.each(aMessageList, function (oMessage) {
|
||||
if (!oNextMessage && oMessage)
|
||||
{
|
||||
if (bGetNext && !oMessage.checked() && !oMessage.deleted() && !oMessage.selected())
|
||||
{
|
||||
oNextMessage = oMessage;
|
||||
}
|
||||
else if (!bGetNext && oMessage.selected())
|
||||
{
|
||||
bGetNext = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (oNextMessage)
|
||||
{
|
||||
this.currentMessage(oNextMessage);
|
||||
}
|
||||
}
|
||||
|
||||
oData.messageListIsNotCompleted(true);
|
||||
|
||||
_.each(aMessages, function (oMessage) {
|
||||
if (oCurrentMessage && oCurrentMessage.requestHash === oMessage.requestHash)
|
||||
if (oCurrentMessage && oCurrentMessage.hash === oMessage.hash)
|
||||
{
|
||||
oCurrentMessage = null;
|
||||
oData.message(null);
|
||||
|
|
@ -16646,7 +16748,7 @@ WebMailAjaxRemoteStorage.prototype.messagesMove = function (fCallback, sFolder,
|
|||
'FromFolder': sFolder,
|
||||
'ToFolder': sToFolder,
|
||||
'Uids': aUids.join(',')
|
||||
}, null, '', ['MessageList', 'Message']);
|
||||
}, null, '', ['MessageList']);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -16674,7 +16776,7 @@ WebMailAjaxRemoteStorage.prototype.messagesDelete = function (fCallback, sFolder
|
|||
this.defaultRequest(fCallback, 'MessageDelete', {
|
||||
'Folder': sFolder,
|
||||
'Uids': aUids.join(',')
|
||||
}, null, '', ['MessageList', 'Message']);
|
||||
}, null, '', ['MessageList']);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -17942,10 +18044,13 @@ function RainLoopApp()
|
|||
this.oData = null;
|
||||
this.oRemote = null;
|
||||
this.oCache = null;
|
||||
this.oMoveCache = {};
|
||||
|
||||
this.quotaDebounce = _.debounce(this.quota, 1000 * 30);
|
||||
this.moveOrDeleteResponseHelper = _.bind(this.moveOrDeleteResponseHelper, this);
|
||||
|
||||
this.messagesMoveTrigger = _.debounce(this.messagesMoveTrigger, 500);
|
||||
|
||||
window.setInterval(function () {
|
||||
RL.pub('interval.30s');
|
||||
}, 30000);
|
||||
|
|
@ -18095,6 +18200,57 @@ RainLoopApp.prototype.recacheInboxMessageList = function ()
|
|||
RL.remote().messageList(Utils.emptyFunction, 'INBOX', 0, RL.data().messagesPerPage(), '', true);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
{
|
||||
RL.reloadMessageList(bEmptyList);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveTrigger = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
_.each(this.oMoveCache, function (oItem) {
|
||||
RL.remote().messagesMove(self.moveOrDeleteResponseHelper, oItem['From'], oItem['To'], oItem['Uid']);
|
||||
});
|
||||
|
||||
this.oMoveCache = {};
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
||||
{
|
||||
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
|
||||
if (!this.oMoveCache[sH])
|
||||
{
|
||||
this.oMoveCache[sH] = {
|
||||
'From': sFromFolderFullNameRaw,
|
||||
'To': sToFolderFullNameRaw,
|
||||
'Uid': []
|
||||
};
|
||||
}
|
||||
|
||||
this.oMoveCache[sH]['Uid'] = _.union(this.oMoveCache[sH]['Uid'], aUidForMove);
|
||||
this.messagesMoveTrigger();
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
||||
{
|
||||
RL.remote().messagesCopy(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
sToFolderFullNameRaw,
|
||||
aUidForCopy
|
||||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
RL.remote().messagesDelete(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && RL.data().currentFolder())
|
||||
|
|
@ -18114,7 +18270,7 @@ RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
|||
}
|
||||
}
|
||||
|
||||
RL.reloadMessageList(0 === RL.data().messageList().length);
|
||||
RL.reloadMessageListHelper(0 === RL.data().messageList().length);
|
||||
RL.quotaDebounce();
|
||||
}
|
||||
};
|
||||
|
|
@ -18125,12 +18281,7 @@ RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
|||
*/
|
||||
RainLoopApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
RL.remote().messagesDelete(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
RL.data().removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
};
|
||||
|
||||
|
|
@ -18186,25 +18337,14 @@ RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFol
|
|||
{
|
||||
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
|
||||
|
||||
RL.remote().messagesDelete(
|
||||
self.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
self.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
oData.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
|
||||
}]);
|
||||
}
|
||||
else if (oMoveFolder)
|
||||
{
|
||||
RL.remote().messagesMove(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
sFromFolderFullNameRaw,
|
||||
oMoveFolder.fullNameRaw,
|
||||
aUidForRemove
|
||||
);
|
||||
|
||||
this.messagesMoveHelper(sFromFolderFullNameRaw, oMoveFolder.fullNameRaw, aUidForRemove);
|
||||
oData.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove, oMoveFolder.fullNameRaw);
|
||||
}
|
||||
};
|
||||
|
|
@ -18226,14 +18366,14 @@ RainLoopApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, a
|
|||
|
||||
if (oFromFolder && oToFolder)
|
||||
{
|
||||
bCopy = Utils.isUnd(bCopy) ? false : !!bCopy;
|
||||
|
||||
RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove'](
|
||||
this.moveOrDeleteResponseHelper,
|
||||
oFromFolder.fullNameRaw,
|
||||
oToFolder.fullNameRaw,
|
||||
aUidForMove
|
||||
);
|
||||
if (Utils.isUnd(bCopy) ? false : !!bCopy)
|
||||
{
|
||||
this.messagesCopyHelper(oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForMove);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.messagesMoveHelper(oFromFolder.fullNameRaw, oToFolder.fullNameRaw, aUidForMove);
|
||||
}
|
||||
|
||||
RL.data().removeMessagesFromList(oFromFolder.fullNameRaw, aUidForMove, oToFolder.fullNameRaw, bCopy);
|
||||
return true;
|
||||
|
|
|
|||
17
rainloop/v/0.0.0/static/js/app.min.js
vendored
17
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue