New styles for toltips (Opentip)

Selector new functionality
x-script tag support for templates
This commit is contained in:
RainLoop Team 2015-04-01 22:18:15 +04:00
parent c1c817c837
commit 80c5e35a29
47 changed files with 2641 additions and 315 deletions

View file

@ -15,6 +15,16 @@
'Unload': 'unload'
};
/**
* @enum {string}
*/
Enums.Focused = {
'None': 'none',
'MessageList': 'message-list',
'MessageView': 'message-view',
'FolderList': 'folder-list'
};
/**
* @enum {number}
*/

View file

@ -25,18 +25,13 @@
/**
* @type {?}
*/
Globals.now = (new window.Date()).getTime();
Globals.startMicrotime = (new window.Date()).getTime();
/**
* @type {?}
*/
Globals.dropdownVisibility = ko.observable(false).extend({'rateLimit': 0});
/**
* @type {?}
*/
Globals.tooltipTrigger = ko.observable(false).extend({'rateLimit': 0});
/**
* @type {boolean}
*/
@ -258,14 +253,13 @@
});
Globals.keyScopeReal.subscribe(function (sValue) {
// window.console.log(sValue);
// window.console.log('keyScope=' + sValue); // TODO
key.setScope(sValue);
});
Globals.dropdownVisibility.subscribe(function (bValue) {
if (bValue)
{
Globals.tooltipTrigger(!Globals.tooltipTrigger());
Globals.keyScope(Enums.KeyState.Menu);
}
else if (Enums.KeyState.Menu === key.getScope())

View file

@ -208,14 +208,6 @@
return this.sBase + 'mailbox/' + sInboxFolderName;
};
/**
* @return {string}
*/
Links.prototype.messagePreview = function ()
{
return this.sBase + 'mailbox/message-preview';
};
/**
* @param {string=} sScreenName
* @return {string}

View file

@ -88,7 +88,7 @@
}, this);
this.selectedItem.extend({'toggleSubscribe': [null,
this.selectedItem = this.selectedItem.extend({'toggleSubscribe': [null,
function (oPrev) {
if (oPrev)
{
@ -102,7 +102,7 @@
}
]});
this.focusedItem.extend({'toggleSubscribe': [null,
this.focusedItem = this.focusedItem.extend({'toggleSubscribe': [null,
function (oPrev) {
if (oPrev)
{
@ -116,6 +116,8 @@
}
]});
this.iSelectNextHelper = 0;
this.iFocusedNextHelper = 0;
this.oContentVisible = null;
this.oContentScrollable = null;
@ -257,6 +259,39 @@
self.focusedItem(self.selectedItem());
}
}
if ((0 !== this.iSelectNextHelper || 0 !== this.iFocusedNextHelper) && 0 < aItems.length && !self.focusedItem())
{
oTemp = null;
if (0 !== this.iFocusedNextHelper)
{
oTemp = aItems[-1 === this.iFocusedNextHelper ? aItems.length - 1 : 0] || null;
}
if (!oTemp && 0 !== this.iSelectNextHelper)
{
oTemp = aItems[-1 === this.iSelectNextHelper ? aItems.length - 1 : 0] || null;
}
if (oTemp)
{
if (0 !== this.iSelectNextHelper)
{
self.selectedItem(oTemp || null);
}
self.focusedItem(oTemp || null);
self.scrollToFocused();
_.delay(function () {
self.scrollToFocused();
}, 100);
}
this.iSelectNextHelper = 0;
this.iFocusedNextHelper = 0;
}
}
aCache = [];
@ -295,6 +330,12 @@
this.newSelectPosition(Enums.EventKeyCode.Up, false, bForceSelect);
};
Selector.prototype.unselect = function ()
{
this.selectedItem(null);
this.focusedItem(null);
};
Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeyScope)
{
this.oContentVisible = oContentVisible;
@ -493,7 +534,7 @@
}
});
if (!oResult && bForceSelect && (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode))
if (!oResult && (Enums.EventKeyCode.Down === iEventKeyCode || Enums.EventKeyCode.Up === iEventKeyCode))
{
this.doUpUpOrDownDown(Enums.EventKeyCode.Up === iEventKeyCode);
}