summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-02-14 06:10:00 -0800
committerBart Visscher <bartv@thisnet.nl>2013-02-14 06:10:00 -0800
commitf4c9d4c06797a5c9e2f30d20a8e13686e98dd7f9 (patch)
treeaf8caa963a78089ad8d8716aac0625acfd13c4c4 /apps/files
parentae172ce7de767096b83f2626f889bc402c5a27c3 (diff)
parent022993c09865b90993c869053a3217e2700a6f22 (diff)
downloadnextcloud-server-f4c9d4c06797a5c9e2f30d20a8e13686e98dd7f9.tar.gz
nextcloud-server-f4c9d4c06797a5c9e2f30d20a8e13686e98dd7f9.zip
Merge pull request #1682 from owncloud/fix-ie8-master
Fix ie8 master
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/jquery-visibility.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files/js/jquery-visibility.js b/apps/files/js/jquery-visibility.js
index a824bf68730..18f57d1f2bd 100644
--- a/apps/files/js/jquery-visibility.js
+++ b/apps/files/js/jquery-visibility.js
@@ -3,7 +3,7 @@
var prefix,
property,
-// In Opera, `'onfocusin' in document == true`, hence the extra `hasFocus` check to detect IE-like behavior
+ // In Opera, `'onfocusin' in document == true`, hence the extra `hasFocus` check to detect IE-like behavior
eventName = 'onfocusin' in document && 'hasFocus' in document ? 'focusin focusout' : 'focus blur',
prefixes = ['', 'moz', 'ms', 'o', 'webkit'],
$support = $.support,
@@ -19,12 +19,11 @@
$(/blur$/.test(eventName) ? window : document).on(eventName, function (event) {
var type = event.type,
- originalEvent = event.originalEvent,
- toElement = originalEvent.toElement;
-// If it’s a `{focusin,focusout}` event (IE), `fromElement` and `toElement` should both be `null` or `undefined`;
-// else, the page visibility hasn’t changed, but the user just clicked somewhere in the doc.
-// In IE9, we need to check the `relatedTarget` property instead.
- if (!/^focus./.test(type) || (toElement == undefined && originalEvent.fromElement == undefined && originalEvent.relatedTarget == undefined)) {
+ originalEvent = event.originalEvent;
+ // If it’s a `{focusin,focusout}` event (IE), `fromElement` and `toElement` should both be `null` or `undefined`;
+ // else, the page visibility hasn’t changed, but the user just clicked somewhere in the doc.
+ // In IE9, we need to check the `relatedTarget` property instead.
+ if (!/^focus./.test(type) || originalEvent == undefined || (originalEvent.toElement == undefined && originalEvent.fromElement == undefined && originalEvent.relatedTarget == undefined)) {
$event.trigger((property && document[property] || /^(?:blur|focusout)$/.test(type) ? 'hide' : 'show') + '.visibility');
}
});