diff --git a/src/plugins.js b/src/plugins.js index 69b2ca3..095008d 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -1156,7 +1156,7 @@ GA.plugins = function(ga) { //Sine sine: function(x) {return Math.sin(x * Math.PI / 2);}, sineSquared: function(x) {return Math.pow(Math.sin(x * Math.PI / 2), 2);}, - sineCubed: function(x) {return Math.pow(Math.sin(x * Math.PI / 2), 2);}, + sineCubed: function(x) {return Math.pow(Math.sin(x * Math.PI / 2), 3);}, inverseSine: function(x) {return 1 - Math.sin((1 - x) * Math.PI / 2);}, inverseSineSquared: function(x) {return 1 - Math.pow(Math.sin((1 - x) * Math.PI / 2), 2);}, inverseSineCubed: function(x) {return 1 - Math.pow(Math.sin((1 - x) * Math.PI / 2), 3);}, @@ -4556,7 +4556,7 @@ GA.plugins = function(ga) { //`requestFullscreen` is used by `enableFullscreen` to launch //fullscreen mode. ga.requestFullScreen = function() { - if (!document.fullscreenEnabled) { + if (document.fullscreenEnabled && document.fullscreenElement !== null) { ga.canvas.requestFullscreen(); } }; @@ -4564,7 +4564,7 @@ GA.plugins = function(ga) { //`exitFullscreen` is used by `enableFullscreen` to exit //fullscreen mode. ga.exitFullScreen = function() { - if (document.fullscreenEnabled) { + if (document.fullscreenEnabled && document.fullscreenElement === null) { document.exitFullscreen(); } };