Починил сортировку игр в Chrome
This commit is contained in:
parent
1f9aae3b1f
commit
be55530bd0
|
@ -7,7 +7,7 @@ function understrap_remove_scripts() {
|
|||
}
|
||||
add_action( 'wp_enqueue_scripts', 'understrap_remove_scripts', 20 );
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
|
||||
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 20 );
|
||||
function theme_enqueue_styles() {
|
||||
|
||||
// Get the theme data
|
||||
|
|
|
@ -21,21 +21,22 @@ jQuery(document).ready(function($){
|
|||
jQuery(".order-buttons input").attr("checked", "");
|
||||
jQuery(this).attr("checked", "checked");
|
||||
jQuery(this).parent().toggleClass("active");
|
||||
//jQuery(this).parent().button('toggle');
|
||||
let value = jQuery(this).val();
|
||||
//console.log(value);
|
||||
let value = jQuery(this).val().trim();
|
||||
switch (value) {
|
||||
case 'name':
|
||||
jQuery(".gamelist").each(function(index, list) {
|
||||
list = jQuery(list);
|
||||
let games = list.children();
|
||||
let games = Array.from(list.children());
|
||||
games.sort(function(a, b) {
|
||||
let nameA = jQuery(a).find(".nGameName").text();
|
||||
let nameB = jQuery(b).find(".nGameName").text();
|
||||
return (nameA > nameB);
|
||||
let nameA = jQuery(a).find(".nGameName").text().trim();
|
||||
let nameB = jQuery(b).find(".nGameName").text().trim();
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
});
|
||||
list.empty();
|
||||
games.appendTo(list);
|
||||
list.append(games);
|
||||
});
|
||||
break;
|
||||
case 'random':
|
||||
|
|
Loading…
Reference in a new issue