Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103705406
activeElement.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Mar 4, 03:57
Size
669 B
Mime Type
text/x-java
Expires
Thu, Mar 6, 03:57 (2 d)
Engine
blob
Format
Raw Data
Handle
24649850
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
activeElement.js
View Options
import ownerDocument from './ownerDocument';
/**
* Returns the actively focused element safely.
*
* @param doc the document to check
*/
export default function activeElement(doc) {
if (doc === void 0) {
doc = ownerDocument();
}
// Support: IE 9 only
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
try {
var active = doc.activeElement; // IE11 returns a seemingly empty object in some cases when accessing
// document.activeElement from an <iframe>
if (!active || !active.nodeName) return null;
return active;
} catch (e) {
/* ie throws if no active element */
return doc.body;
}
}
Event Timeline
Log In to Comment