We need to go deeper

This commit is contained in:
Zixaphir 2013-03-19 09:52:19 -07:00
parent a5fb6e26db
commit 6d59cc03f1
2 changed files with 8 additions and 10 deletions

View File

@ -1109,10 +1109,7 @@
visibility: function() {
var event, prefix, property;
if ('visibilityState' in document) {
return;
}
if (!(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) {
if ('visibilityState' in document || !(prefix = ('webkitVisibilityState' in document ? 'webkit' : 'mozVisibilityState' in document ? 'moz' : void 0))) {
return;
}
property = prefix + 'VisibilityState';

View File

@ -3,12 +3,13 @@ Polyfill =
Polyfill.visibility()
visibility: ->
# page visibility API
return if 'visibilityState' of document
return unless prefix = (
if 'webkitVisibilityState' of document
'webkit'
else if 'mozVisibilityState' of document
'moz'
return if 'visibilityState' of document or not (
prefix = (
if 'webkitVisibilityState' of document
'webkit'
else if 'mozVisibilityState' of document
'moz'
)
)
property = prefix + 'VisibilityState'