Skip to content

Commit

Permalink
Replace deprecated live() function with on()
Browse files Browse the repository at this point in the history
The live() function is deprecated and no longer exists in modern
versions of jQuery. The replacement used in this plugin is the
on() function.

This fixes a compatibility issue with WordPress 5.5.
  • Loading branch information
fabiorino committed Aug 9, 2020
1 parent 573ce08 commit 4f50013
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crellyslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Crelly Slider
* Plugin URI: https://wordpress.org/plugins/crelly-slider/
* Description: A free responsive slider that supports layers. Add texts, images, videos and beautify them with transitions and animations.
* Version: 1.4.2
* Version: 1.4.3
* Author: Fabio Rinaldi
* Author URI: https://github.com/fabiorino
* Text Domain: crelly-slider
Expand All @@ -18,7 +18,7 @@

define('CS_DEBUG', true);

define('CS_VERSION', '1.4.2');
define('CS_VERSION', '1.4.3');
define('CS_MIN_CAPABILITY', 'manage_options');
define('CS_PATH', plugin_dir_path(__FILE__));
define('CS_PLUGIN_URL', plugins_url() . '/crelly-slider');
Expand Down
2 changes: 1 addition & 1 deletion css/crellyslider.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Plugin Name: Crelly Slider
* Plugin URI: https://wordpress.org/plugins/crelly-slider/
* Description: A free responsive slider that supports layers. Add texts, images, videos and beautify them with transitions and animations.
* Version: 1.4.2
* Version: 1.4.3
* Author: Fabio Rinaldi
* Author URI: https://github.com/fabiorino
* License: MIT
Expand Down
2 changes: 1 addition & 1 deletion css/crellyslider.min.css

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

2 changes: 1 addition & 1 deletion js/jquery.crellyslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Plugin Name: Crelly Slider
* Plugin URI: https://wordpress.org/plugins/crelly-slider/
* Description: A free responsive slider that supports layers. Add texts, images, videos and beautify them with transitions and animations.
* Version: 1.4.2
* Version: 1.4.3
* Author: Fabio Rinaldi
* Author URI: https://github.com/fabiorino
* License: MIT
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.crellyslider.min.js

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

5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://crellyslider.altervista.org/contribute-and-support/
Tags: slider, layers, animations, transitions, texts, images, videos
Requires at least: 4.6
Tested up to: 5.4
Stable tag: 1.4.2
Stable tag: 1.4.3
License: MIT
License URI: http://opensource.org/licenses/MIT

Expand Down Expand Up @@ -54,6 +54,9 @@ You can find the documentation <a href="http://crellyslider.altervista.org/docum

== Changelog ==

= 1.4.3 =
* Fixed compatibility issue with WordPress 5.5 due to the use of a deprecated jQuery function.

= 1.4.2 =
* Push required version of WordPress to 4.6.

Expand Down
6 changes: 3 additions & 3 deletions wordpress/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
$('.cs-slide-tabs .cs-sortable li').disableSelection();

// Show the slide when clicking on the link
$('.cs-admin #cs-slides .cs-slide-tabs > ul > li > a').live('click', function() {
$('.cs-admin #cs-slides').on('click', '.cs-slide-tabs > ul > li > a', function() {
crellyslider_deselectElements();

// Do only if is not click add new
Expand Down Expand Up @@ -306,7 +306,7 @@
}

// Delete
$('.cs-admin #cs-slides .cs-slide-tabs > ul > li .cs-close').live('click', function() {
$('.cs-admin #cs-slides').on('click', '.cs-slide-tabs > ul > li .cs-close', function() {
if($('.cs-admin #cs-slides .cs-slide-tabs > ul > li').length <= 2) {
alert(crellyslider_translations.slide_delete_just_one);
return;
Expand Down Expand Up @@ -349,7 +349,7 @@
});

// Duplicate
$('.cs-admin #cs-slides .cs-slide-tabs > ul > li .cs-duplicate').live('click', function() {
$('.cs-admin #cs-slides').on('click', '.cs-slide-tabs > ul > li .cs-duplicate', function() {
var slide_index = $(this).parent().index();
var slide = $('.cs-admin #cs-slides .cs-slides-list .cs-slide').eq(slide_index);

Expand Down

0 comments on commit 4f50013

Please sign in to comment.