WP PLUGIN
・カスタムフィールドの必須チェック漏れの修正 ・既存カスタムフィールド選択も可能なよう修正 ・ソートのリストに背景色を設定 ・並べ替え設定ページの更新ボタン位置を修正 ・カテゴリー、タグ、カスタム分類のソート対象選択のラジオボタン並び順を標準、検索と同一になるよう修正
This commit is contained in:
+59
-1
@@ -18,6 +18,8 @@ jQuery(function ($) {
|
||||
|
||||
change_normal_field_sort();
|
||||
|
||||
custom_field_select();
|
||||
|
||||
function change_tab_menu() {
|
||||
let apop_submit_type = $('#apop_submit_type');
|
||||
let order_nav_list = $('.post-order-nav li');
|
||||
@@ -153,7 +155,7 @@ jQuery(function ($) {
|
||||
|
||||
function change_normal_field_sort() {
|
||||
let s_box = $('.sort_box');
|
||||
let targets = '.custom_field_check, .sort_date_check, .sort_title_check, .sort_ID_check, .sort_modified_check';
|
||||
let targets = '.sort_date_check, .sort_title_check, .sort_ID_check, .sort_modified_check';
|
||||
s_box.find(targets).each(function () {
|
||||
if ($(this).prop('checked') == false) {
|
||||
$(this).parents('.product-list-sort-type').find('.order_param').prop('disabled', true);
|
||||
@@ -174,4 +176,60 @@ jQuery(function ($) {
|
||||
});
|
||||
}
|
||||
|
||||
function custom_field_select() {
|
||||
let s_box = $('.sort_box');
|
||||
let targets = $('.custom-field-type');
|
||||
let en_dis_check = $('.custom_field_check');
|
||||
|
||||
// カスタムフィールドソートの有効・無効を判定する。
|
||||
// 有効の場合はカスタムフィールド選択or追加のステータスに応じてテキストエリアとセレクトタグenableに変更し表示を切り替える。
|
||||
// 無効の場合はカスタムフィールドのテキストエリアとセレクトタグをDisableにし無効ボックスに移動する。
|
||||
s_box.find('.custom_field_check').each(function () {
|
||||
if ($(this).prop('checked') == false) {
|
||||
let disable_list = $(this).parents('.sort_box').find('.disable-normal-list');
|
||||
$(this).parents('li').appendTo(disable_list);
|
||||
dis_list($(this));
|
||||
} else {
|
||||
let target_type = $(this).parents('.product-list-sort-type').find('.custom-field-type').filter(':checked').val();
|
||||
en_dis_list($(this), target_type);
|
||||
}
|
||||
});
|
||||
|
||||
//有効・無効チェックボックスクリック時
|
||||
en_dis_check.on('click', function () {
|
||||
if ($(this).prop('checked') == true) {
|
||||
let enable_list = $(this).parents('.sort_box').find('.post-order-list');
|
||||
let target_type = $(this).parents('.product-list-sort-type').find('.custom-field-type').filter(':checked').val();
|
||||
$(this).parents('.product-list-sort-type').find('.order_param').prop('disabled', false);
|
||||
$(this).parents('li').appendTo(enable_list).removeClass('no-order').hide().fadeIn(200);
|
||||
en_dis_list($(this), target_type);
|
||||
} else {
|
||||
let disable_list = $(this).parents('.sort_box').find('.disable-normal-list');
|
||||
$(this).parents('.product-list-sort-type').find('.order_param').prop('disabled', true);
|
||||
$(this).parents('li').appendTo(disable_list).addClass('no-order').hide().fadeIn(200);
|
||||
dis_list($(this));
|
||||
}
|
||||
});
|
||||
|
||||
//選択・追加のカスタムフィールド種類ラジオボタンのクリック
|
||||
targets.on('click', function () {
|
||||
en_dis_list($(this), $(this).val());
|
||||
});
|
||||
|
||||
function dis_list(obj) {
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key').prop('disabled', true);
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key_select').prop('disabled', true);
|
||||
}
|
||||
|
||||
function en_dis_list(obj, type) {
|
||||
if (type == 1) {
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key_select').prop('disabled', false).show();
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key').prop('disabled', true).hide();
|
||||
} else if (type == 2) {
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key').prop('disabled', false).show();
|
||||
obj.parents('.product-list-sort-type').find('.custom_field_key_select').prop('disabled', true).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user