WP PLUGIN アーカイブページの投稿表示順設定
・検索と通常表示のオプションを追加 ・項目の表示順を修正 ・選択値によって表示/非表示の切り替えやフォームをDisabledにする等修正 ・アンインストーラーを追加
This commit is contained in:
+72
-17
@@ -1,10 +1,21 @@
|
||||
jQuery(function ($) {
|
||||
|
||||
//tab menu
|
||||
change_tab_menu();
|
||||
|
||||
//custom orders
|
||||
order_list();
|
||||
|
||||
//order type
|
||||
change_search_order();
|
||||
change_normal_order();
|
||||
|
||||
en_search_normal_sort_btn()
|
||||
|
||||
//per page
|
||||
disp_tax_per_page();
|
||||
change_normal_per_page();
|
||||
change_search_per_page();
|
||||
change_search_order_options();
|
||||
change_cat_per_page();
|
||||
change_tag_per_page();
|
||||
change_tax_per_page();
|
||||
@@ -51,6 +62,65 @@ jQuery(function ($) {
|
||||
}
|
||||
}
|
||||
|
||||
function change_normal_order() {
|
||||
let s_radio = $('.apop_normal_order');
|
||||
let s_box = $('.normal_sort_box');
|
||||
let default_index = $('.apop_normal_order_target').data('normal_order_target') - 1;
|
||||
|
||||
s_box.hide().find('input').each(function () {
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
$('.normal_sort_box:eq(' + default_index + ')').show().find('input').prop('disabled', false);
|
||||
|
||||
s_radio.click(function () {
|
||||
let target_index = $(this).val() - 1;
|
||||
s_box.hide().find('input').each(function () {
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
$('.normal_sort_box:eq(' + target_index + ')').show().find('input').prop('disabled', false);
|
||||
})
|
||||
}
|
||||
|
||||
function change_search_order() {
|
||||
let s_radio = $('.apop_search_order');
|
||||
let s_box = $('.search_sort_box');
|
||||
let default_index = $('.apop_search_order_target').data('search_order_target') - 1;
|
||||
|
||||
s_box.hide().find('input').each(function () {
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
|
||||
$('.search_sort_box:eq(' + default_index + ')').show().find('input').prop('disabled', false);
|
||||
|
||||
s_radio.click(function () {
|
||||
let target_index = $(this).val() - 1;
|
||||
s_box.hide().find('input').each(function () {
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
$('.search_sort_box:eq(' + target_index + ')').show().find('input').prop('disabled', false);
|
||||
})
|
||||
}
|
||||
|
||||
function disp_tax_per_page() {
|
||||
let box_count = $('.order_setting_list').length;
|
||||
for (let i = 0; i < box_count; i++) {
|
||||
$('.order_setting_list:eq(' + i + ')').click(function () {
|
||||
let en_count = $('.order_setting_list:eq(' + i + ') [name^="_apop_"]:checked').length;
|
||||
if (en_count == 0) {
|
||||
$(this).parent().next('dt').addClass('hide_list').next('dd').addClass('hide_list');
|
||||
} else {
|
||||
$(this).parent().next('dt').removeClass('hide_list').next('dd').removeClass('hide_list');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function change_normal_per_page() {
|
||||
let per_page_cat = $('.per_page_normal');
|
||||
let per_page_input = $('.per_page_normal_input');
|
||||
change_per_page(per_page_cat, per_page_input);
|
||||
}
|
||||
|
||||
function change_search_per_page() {
|
||||
let per_page_cat = $('.per_page_search');
|
||||
let per_page_input = $('.per_page_search_input');
|
||||
@@ -82,7 +152,7 @@ jQuery(function ($) {
|
||||
per_page_input.prop('disabled', false);
|
||||
}
|
||||
per_page_cat.click(function () {
|
||||
if ($(this).val() == 'set') {
|
||||
if ($(this).val() != 'default' && $(this).val() != '-1' && $(this).val() != 'all') {
|
||||
per_page_input.prop('disabled', false);
|
||||
} else {
|
||||
per_page_input.val('');
|
||||
@@ -91,19 +161,4 @@ jQuery(function ($) {
|
||||
})
|
||||
}
|
||||
|
||||
function change_search_order_options() {
|
||||
let s_radio = $('.apop_search_order');
|
||||
let s_box = $('.search_sort_box');
|
||||
let default_index = $('.apop_search_order_target').data('search_order_target') - 1;
|
||||
|
||||
s_box.hide();
|
||||
$('.search_sort_box:eq(' + default_index + ')').show();
|
||||
|
||||
s_radio.click(function () {
|
||||
let target_index = $(this).val() - 1;
|
||||
s_box.hide();
|
||||
$('.search_sort_box:eq(' + target_index + ')').show();
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user