"making jshint (almost) happy"
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
return memory[ prop ];
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -57,13 +57,13 @@
|
||||
for ( key in props ) {
|
||||
if ( props.hasOwnProperty(key) ) {
|
||||
pkey = pfx(key);
|
||||
if ( pkey != null ) {
|
||||
if ( pkey !== null ) {
|
||||
el.style[pkey] = props[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return el;
|
||||
}
|
||||
};
|
||||
|
||||
var toNumber = function (numeric, fallback) {
|
||||
return isNaN(numeric) ? (fallback || 0) : Number(numeric);
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
var byId = function ( id ) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
};
|
||||
|
||||
var $ = function ( selector, context ) {
|
||||
context = context || document;
|
||||
@@ -113,7 +113,7 @@
|
||||
var body = document.body;
|
||||
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var impressSupported = ( pfx("perspective") != null ) &&
|
||||
var impressSupported = ( pfx("perspective") !== null ) &&
|
||||
( body.classList ) &&
|
||||
( body.dataset ) &&
|
||||
( ua.search(/(iphone)|(ipod)|(android)/) == -1 );
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
perspective: 1000,
|
||||
|
||||
transitionDuration: 1000,
|
||||
transitionDuration: 1000
|
||||
};
|
||||
|
||||
var impress = window.impress = function ( rootId ) {
|
||||
@@ -173,8 +173,8 @@
|
||||
|
||||
perspective: toNumber(rootData.perspective, defaults.perspective),
|
||||
|
||||
transitionDuration: toNumber(rootData.transitionDuration, defaults.transitionDuration),
|
||||
}
|
||||
transitionDuration: toNumber(rootData.transitionDuration, defaults.transitionDuration)
|
||||
};
|
||||
|
||||
var canvas = document.createElement("div");
|
||||
canvas.className = "canvas";
|
||||
@@ -201,7 +201,7 @@
|
||||
transformOrigin: "top left",
|
||||
transition: "all 0s ease-in-out",
|
||||
transformStyle: "preserve-3d"
|
||||
}
|
||||
};
|
||||
|
||||
css(root, props);
|
||||
css(root, {
|
||||
@@ -319,7 +319,7 @@
|
||||
rotate: {
|
||||
x: -step.rotate.x,
|
||||
y: -step.rotate.y,
|
||||
z: -step.rotate.z,
|
||||
z: -step.rotate.z
|
||||
},
|
||||
translate: {
|
||||
x: -step.translate.x,
|
||||
@@ -341,11 +341,12 @@
|
||||
windowScale = computeWindowScale();
|
||||
}
|
||||
|
||||
var targetScale = target.scale * windowScale;
|
||||
|
||||
css(root, {
|
||||
// to keep the perspective look similar for different scales
|
||||
// we need to 'scale' the perspective, too
|
||||
transform: perspective( config.perspective / (target.scale * windowScale) )
|
||||
+ scale(target.scale * windowScale),
|
||||
transform: perspective( config.perspective / targetScale ) + scale( targetScale ),
|
||||
transitionDuration: duration,
|
||||
transitionDelay: (zoomin ? delay : "0ms")
|
||||
});
|
||||
@@ -394,7 +395,7 @@
|
||||
prev: prev
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
})(document, window);
|
||||
|
||||
// EVENTS
|
||||
@@ -402,6 +403,8 @@
|
||||
(function ( document, window ) {
|
||||
'use strict';
|
||||
|
||||
var impress = window.impress;
|
||||
|
||||
// throttling function calls, by Remy Sharp
|
||||
// http://remysharp.com/2010/07/21/throttling-function-calls/
|
||||
var throttle = function (fn, delay) {
|
||||
@@ -428,15 +431,15 @@
|
||||
document.addEventListener("keyup", function ( event ) {
|
||||
if ( event.keyCode == 9 || ( event.keyCode >= 32 && event.keyCode <= 34 ) || (event.keyCode >= 37 && event.keyCode <= 40) ) {
|
||||
switch( event.keyCode ) {
|
||||
case 33: ; // pg up
|
||||
case 37: ; // left
|
||||
case 33: // pg up
|
||||
case 37: // left
|
||||
case 38: // up
|
||||
impress().prev();
|
||||
break;
|
||||
case 9: ; // tab
|
||||
case 32: ; // space
|
||||
case 34: ; // pg down
|
||||
case 39: ; // right
|
||||
case 9: // tab
|
||||
case 32: // space
|
||||
case 34: // pg down
|
||||
case 39: // right
|
||||
case 40: // down
|
||||
impress().next();
|
||||
break;
|
||||
@@ -505,7 +508,7 @@
|
||||
}, false);
|
||||
|
||||
// rescale presentation when window is resized
|
||||
window.addEventListener("resize", throttle(function (event) {
|
||||
window.addEventListener("resize", throttle(function () {
|
||||
// force going to active step again, to trigger rescaling
|
||||
impress().stepTo( document.querySelector(".active"), true );
|
||||
}, 250), false);
|
||||
|
||||
Reference in New Issue
Block a user