Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

WP 5.6 jQuery changes #1791

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions jquery.flexslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

// KEYBOARD:
if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) {
$(document).bind('keyup', function(event) {
$(document).on('keyup', function(event) {
var keycode = event.keyCode;
if (!slider.animating && (keycode === 39 || keycode === 37)) {
var target = (slider.vars.rtl?
Expand All @@ -121,7 +121,7 @@
}
// MOUSEWHEEL:
if (slider.vars.mousewheel) {
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
slider.on('mousewheel', function(event, delta, deltaX, deltaY) {
event.preventDefault();
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
slider.flexAnimate(target, slider.vars.pauseOnAction);
Expand All @@ -137,9 +137,10 @@
// SLIDSESHOW
if (slider.vars.slideshow) {
if (slider.vars.pauseOnHover) {
slider.hover(function() {
slider.on('mouseenter', function() {
if (!slider.manualPlay && !slider.manualPause) { slider.pause(); }
}, function() {
});
slider.on('mouseout', function() {
if (!slider.manualPause && !slider.manualPlay && !slider.stopped) { slider.play(); }
});
}
Expand All @@ -157,7 +158,7 @@
if (touch && slider.vars.touch) { methods.touch(); }

// FADE&&SMOOTHHEIGHT || SLIDE:
if (!fade || (fade && slider.vars.smoothHeight)) { $(window).bind("resize orientationchange focus", methods.resize); }
if (!fade || (fade && slider.vars.smoothHeight)) { $(window).on("resize orientationchange focus", methods.resize); }

slider.find("img").attr("draggable", "false");

Expand Down Expand Up @@ -274,7 +275,7 @@

methods.controlNav.active();

slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
slider.controlNavScaffold.on( eventType, 'a, img', function(event) {
event.preventDefault();

if (watchedEvent === "" || watchedEvent === event.type) {
Expand All @@ -299,7 +300,7 @@
slider.controlNav = slider.manualControls;
methods.controlNav.active();

slider.controlNav.bind(eventType, function(event) {
slider.controlNav.on(eventType, function(event) {
event.preventDefault();

if (watchedEvent === "" || watchedEvent === event.type) {
Expand Down Expand Up @@ -356,7 +357,7 @@

methods.directionNav.update();

slider.directionNav.bind(eventType, function(event) {
slider.directionNav.on(eventType, function(event) {
event.preventDefault();
var target;

Expand Down Expand Up @@ -404,7 +405,7 @@

methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play');

slider.pausePlay.bind(eventType, function(event) {
slider.pausePlay.on(eventType, function(event) {
event.preventDefault();

if (watchedEvent === "" || watchedEvent === event.type) {
Expand Down Expand Up @@ -794,8 +795,8 @@
}

// Unbind previous transitionEnd events and re-bind new transitionEnd event
slider.container.unbind("webkitTransitionEnd transitionend");
slider.container.bind("webkitTransitionEnd transitionend", function() {
slider.container.off("webkitTransitionEnd transitionend");
slider.container.on("webkitTransitionEnd transitionend", function() {
clearTimeout(slider.ensureAnimationEnd);
slider.wrapup(dimension);
});
Expand Down Expand Up @@ -976,14 +977,14 @@
slider.doMath();
if(slider.vars.rtl){
if (slider.isFirefox) {
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "right", "display": "block"});
slider.newSlides.css({"width": slider.computedW + 'px', "marginRight" : slider.computedM + 'px', "float": "right", "display": "block"});
} else {
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
slider.newSlides.css({"width": slider.computedW + 'px', "marginRight" : slider.computedM + 'px', "float": "left", "display": "block"});
}

}
else{
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
slider.newSlides.css({"width": slider.computedW + 'px', "marginRight" : slider.computedM + 'px', "float": "left", "display": "block"});
}
// SMOOTH HEIGHT:
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
Expand Down Expand Up @@ -1142,9 +1143,9 @@
};

// Ensure the slider isn't focussed if the window loses focus.
$( window ).blur( function ( e ) {
$( window ).on( 'blur', function ( e ) {
focused = false;
}).focus( function ( e ) {
}).on( 'focus', function ( e ) {
focused = true;
});

Expand Down