Skip to content

Commit

Permalink
Fixes mobile overwrite of prototype methods
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneriley committed Sep 3, 2019
1 parent b85ad8f commit 15e1c9b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions BookReader/plugins/plugin.vendor-fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

(function(BR) {
var event_namespace = '.bookreader_vendor-fullscreen';
var super_methods = {};
function isMobile() {
return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);
};

if (isMobile()) { return; }

jQuery.extend(BR.defaultOptions, {
enableVendorFullscreenPlugin: true
});

BR.prototype.setup = (function(super_) {
super_methods.setup = super_;
return function(options) {
super_.call(this, options);

Expand All @@ -23,7 +23,6 @@
})(BR.prototype.setup);

BR.prototype.getInitialMode = (function(super_) {
super_methods.getInitialMode = super_;
return function(params) {
var nextMode = super_.call(this, params);
if (this.isVendorFullscreenActive) {
Expand All @@ -34,12 +33,6 @@
})(BR.prototype.getInitialMode);

BR.prototype.init = (function(super_) {
if (isMobile()) {
for (var method in super_methods) {
BR.prototype[method] = super_methods[method];
}
return;
}
return function() {
super_.call(this);

Expand Down Expand Up @@ -180,8 +173,7 @@
return (document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullScreenEnabled) &&
!isMobile();
document.msFullScreenEnabled);
};

/**
Expand Down

0 comments on commit 15e1c9b

Please sign in to comment.