Skip to content

Commit

Permalink
Generate dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jul 27, 2019
1 parent 9e4293b commit e9fabda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions dist/screenfull.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* screenfull
* v4.2.0 - 2019-04-01
* v4.2.1 - 2019-07-27
* (c) Sindre Sorhus; MIT License
*/
(function () {
Expand Down Expand Up @@ -84,27 +84,31 @@

var screenfull = {
request: function (elem) {
return new Promise(function (resolve) {
return new Promise(function (resolve, reject) {
var request = fn.requestFullscreen;

var onFullScreenEntered = function () {
this.off('change', onFullScreenEntered);
resolve();
}.bind(this);

this.on('change', onFullScreenEntered);

elem = elem || document.documentElement;

var promise;

// Work around Safari 5.1 bug: reports support for
// keyboard in fullscreen even though it doesn't.
// Browser sniffing, since the alternative with
// setTimeout is even worse.
if (/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)) {
elem[request]();
promise = elem[request]();
} else {
elem[request](keyboardAllowed ? Element.ALLOW_KEYBOARD_INPUT : {});
promise = elem[request](keyboardAllowed ? Element.ALLOW_KEYBOARD_INPUT : {});
}

this.on('change', onFullScreenEntered);
Promise.resolve(promise).catch(reject);
}.bind(this));
},
exit: function () {
Expand Down
4 changes: 2 additions & 2 deletions dist/screenfull.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e9fabda

Please sign in to comment.