mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Fix cke editor focus detection
This commit is contained in:
parent
9b59ad32dc
commit
07b0f20305
7 changed files with 192 additions and 174 deletions
|
|
@ -389,11 +389,17 @@ Utils.initOnStartOrLangChange = function (fCallback, oScope, fLangCallback)
|
|||
*/
|
||||
Utils.inFocus = function ()
|
||||
{
|
||||
var oActiveObj = document.activeElement;
|
||||
return (oActiveObj && ('INPUT' === oActiveObj.tagName ||
|
||||
'TEXTAREA' === oActiveObj.tagName ||
|
||||
'IFRAME' === oActiveObj.tagName ||
|
||||
('DIV' === oActiveObj.tagName && 'editorHtmlArea' === oActiveObj.className && oActiveObj.contentEditable)));
|
||||
if (document.activeElement)
|
||||
{
|
||||
if (Utils.isUnd(document.activeElement.__inFocusCache))
|
||||
{
|
||||
document.activeElement.__inFocusCache = $(document.activeElement).is('input,textarea,iframe,.cke_editable');
|
||||
}
|
||||
|
||||
return !!document.activeElement.__inFocusCache;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Utils.removeInFocus = function ()
|
||||
|
|
@ -401,7 +407,7 @@ Utils.removeInFocus = function ()
|
|||
if (document && document.activeElement && document.activeElement.blur)
|
||||
{
|
||||
var oA = $(document.activeElement);
|
||||
if (oA.is('input') || oA.is('textarea'))
|
||||
if (oA.is('input,textarea'))
|
||||
{
|
||||
document.activeElement.blur();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue