Skip to content

Commit

Permalink
Compatibilidad jQuery wordpress
Browse files Browse the repository at this point in the history
  • Loading branch information
ezemanzur committed Aug 25, 2021
1 parent 97c46bc commit aa452a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions inc/admin/js/wp-dspace-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jQuery(document).ready(function () {

})
jQuery.each(filters, function (i, value) {
jQuery(value.selector).live('change', function () {
jQuery(value.selector).on('change', function () {
jQuery(value.conditional).toggle();
});
});

jQuery("#origen select").live('change', function () {
jQuery("#origen select").on('change', function () {
var selection = jQuery(this).val();
if (jQuery(`#option_${selection}`).attr('support')){
jQuery("div.conditional_config").show();
Expand Down
8 changes: 4 additions & 4 deletions media/js/jquery.pajinate.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$item_container = $(this).find(options.item_container_id);
$items = $page_container.find(options.item_container_id).children();

if (options.abort_on_small_lists && options.items_per_page >= $items.size()) return $page_container;
if (options.abort_on_small_lists && options.items_per_page >= $items.length()) return $page_container;

meta = $page_container;

Expand All @@ -64,7 +64,7 @@
meta.data(items_per_page, options.items_per_page);

// Get the total number of items
var total_items = $item_container.children().size();
var total_items = $item_container.children().length();

// Calculate the number of pages needed
var number_of_pages = Math.ceil(total_items / options.items_per_page);
Expand Down Expand Up @@ -129,7 +129,7 @@

/* Setup Nav Menu Display */
// Page number slices
total_page_no_links = $page_container.find(options.nav_panel_id + ':first').children('.page_link').size();
total_page_no_links = $page_container.find(options.nav_panel_id + ':first').children('.page_link').length();
options.num_page_links_to_display = Math.min(options.num_page_links_to_display, total_page_no_links);

$nav_panels.children('.page_link').hide(); // Hide all the page links
Expand Down Expand Up @@ -233,7 +233,7 @@
/*########## Ajout de l'option page courante + nombre de pages*/
var $current_page = parseInt(meta.data(current_page)+1);
// Get the total number of items
var total_items = $item_container.children().size();
var total_items = $item_container.children().length();
// Calculate the number of pages needed
var $number_of_pages = Math.ceil(total_items / options.items_per_page);
/*##################################################################*/
Expand Down

0 comments on commit aa452a3

Please sign in to comment.