From e15a46eec4dbd977c5ce4945951a9ce887b27574 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 14 Jun 2021 17:20:01 +0900 Subject: [PATCH] =?UTF-8?q?WP=20PLUGIN=20CSS=E4=BF=AE=E6=AD=A3=EF=BC=8B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=99=82=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=82=BF?= =?UTF-8?q?=E3=83=96=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・カテゴリー表示等のCSSについてflexを適用 ・データ更新時に表示するタブが、POST前に開いていたタブになるようPHPとjQyeryを修正 --- css/apop-style.css | 22 ++++++++++-------- js/apop-style.js | 37 +++++++++++++++++++------------ template/order.php | 20 ++++++++--------- template/order_parts_taxonomy.php | 2 +- 4 files changed, 46 insertions(+), 35 deletions(-) diff --git a/css/apop-style.css b/css/apop-style.css index 7c14fa9..54598c3 100644 --- a/css/apop-style.css +++ b/css/apop-style.css @@ -21,7 +21,7 @@ h3 { padding: .5em; text-align: center; background: #ababab; - border: 1px solid #999; + border: 1px solid #ccc; cursor: pointer; } @@ -42,7 +42,7 @@ h3 { .post-order-box-outer { width: 100%; margin: -1px 0 2em; - border: 1px solid #999; + border: 1px solid #ccc; background: #fff; } @@ -52,11 +52,14 @@ h3 { .list-orders-outer { width: 100%; + display: flex; margin-bottom: 1em; + flex-wrap: wrap; + justify-content: space-between; } .list-orders-inner { - width: 50%; + width: calc((100% / 2) - 20px); padding: .5em; position: relative; } @@ -128,7 +131,7 @@ dl.apop_setting_list_dd dd input { background: #fff; cursor: move; color: #4b4b4b; - border: 1px solid #ababab; + border: 1px solid #ccc; } .search_normal_sort .product-list { @@ -220,15 +223,16 @@ dl.apop_setting_list_dd dd input { cursor: default; } -.apop-submit{ - margin:1em .5em; +.apop-submit { + margin: 1em .5em; } -.apop-form_table{ +.apop-form_table { background: #fff; } -.apop-form_table th{ - padding-left:.5em; + +.apop-form_table th { + padding-left: .5em; } @media only screen and (max-width: 1264px) { diff --git a/js/apop-style.js b/js/apop-style.js index ab354fb..54a0d4d 100644 --- a/js/apop-style.js +++ b/js/apop-style.js @@ -19,24 +19,33 @@ jQuery(function ($) { change_normal_field_sort(); function change_tab_menu() { - let submit_type = $('.post-order-box-outer').data('submit_type'); + let apop_submit_type = $('#apop_submit_type'); let order_nav_list = $('.post-order-nav li'); let order_box = $('.post-order-box'); - order_nav_list.removeClass('en'); - order_box.hide(); - $('.post-order-nav li:eq(' + submit_type + ')').addClass('en'); - $('.post-order-box:eq(' + submit_type + ')').show() + init(); + click_menu(); - order_nav_list.on('click', function () { - if (!$(this).hasClass('en')) { - let target_index = $(this).index(); - order_nav_list.removeClass('en'); - $(this).addClass('en'); - order_box.hide(); - $('.post-order-box:eq(' + target_index + ')').show(); - } - }); + function init() { + let submit_type = apop_submit_type.val(); + order_nav_list.removeClass('en'); + order_box.hide(); + $('.post-order-nav li:eq(' + submit_type + ')').addClass('en'); + $('.post-order-box:eq(' + submit_type + ')').show() + } + + function click_menu() { + order_nav_list.on('click', function () { + if (!$(this).hasClass('en')) { + let target_index = $(this).index(); + order_nav_list.removeClass('en'); + $(this).addClass('en'); + order_box.hide(); + $('.post-order-box:eq(' + target_index + ')').show(); + apop_submit_type.val(target_index); + } + }); + } } function order_list() { diff --git a/template/order.php b/template/order.php index 59eaabb..72103de 100644 --- a/template/order.php +++ b/template/order.php @@ -1,5 +1,5 @@

並べ替え

@@ -12,9 +12,10 @@ $submit_type = APOP_UI::input_post_filter( 'submit_type', 'str' );
  • カスタム分類
  • -
    +
    +
    @@ -80,9 +81,8 @@ $submit_type = APOP_UI::input_post_filter( 'submit_type', 'str' );
    APOP_UI::get_cat_tag_list( 'cat', 'category' ) ); - $tax_title_text = 'カテゴリー'; - $submit_type_number = 2; + $tax_lists = array( 'category' => APOP_UI::get_cat_tag_list( 'cat', 'category' ) ); + $tax_title_text = 'カテゴリー'; ?>
    @@ -90,9 +90,8 @@ $submit_type = APOP_UI::input_post_filter( 'submit_type', 'str' );
    APOP_UI::get_cat_tag_list( 'tag', 'post_tag' ) ); - $tax_title_text = 'タグ'; - $submit_type_number = 3; + $tax_lists = array( 'tag_id' => APOP_UI::get_cat_tag_list( 'tag', 'post_tag' ) ); + $tax_title_text = 'タグ'; ?>
    @@ -100,9 +99,8 @@ $submit_type = APOP_UI::input_post_filter( 'submit_type', 'str' );
    APOP_UI::get_cat_tag_list( 'tax', 'taxonomy' ) ); - $tax_title_text = 'カスタム分類'; - $submit_type_number = 4; + $tax_lists = array( 'taxonomy' => APOP_UI::get_cat_tag_list( 'tax', 'taxonomy' ) ); + $tax_title_text = 'カスタム分類'; ?>
    diff --git a/template/order_parts_taxonomy.php b/template/order_parts_taxonomy.php index 3247133..117ee71 100644 --- a/template/order_parts_taxonomy.php +++ b/template/order_parts_taxonomy.php @@ -1,4 +1,4 @@ - + $tax_list ) : ?>
    0 ): ?>