Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

管理画面のバナーが下まで見えない問題の修正 #1408

Merged
merged 5 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 59 additions & 31 deletions inc/vk-admin/package/_scss/vk_admin.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
@charset "utf-8";
// @import "compass";

/*-------------------------------------------*/
/* Layout
/*-------------------------------------------*/
.vk_admin_page {
--vk-admin-layout-gap: 30px;
}

.adminLayout {
display: grid;
gap: var(--vk-admin-layout-gap);

.adminMain {
display: grid;
gap: var(--vk-admin-layout-gap);
}

@media (min-width: 992px) {
.adminMain.column_3 {
grid-template-columns: 240px auto;
}
}

@media (min-width: 1400px) {
grid-template-columns: auto 300px;
}
}

/*-------------------------------------------*/
/* サイドバーの固定処理
/*-------------------------------------------*/
.adminLayout {

@media (min-width: 992px) {
.adminMain_sub_inner {
position: sticky;
top: 30px;
}

}

@media (min-width: 1400px) {
.adminSub {
display: grid;
align-items: end; // end 指定しないと下端吸着しない

&_inner {
position: sticky;
bottom: 30px;

}

}
}
}

/*-------------------------------------------*/
/* common
/*-------------------------------------------*/

$text-size : 14px;
$line-height : 1.7;
Expand Down Expand Up @@ -264,17 +322,8 @@ body {
}

.adminMain {
display: block;
overflow: hidden;
width: 74%;
float: left;

#adminContent_sub {
display: block;
overflow: hidden;
width: 23%;
float: left;
padding-bottom: 10px;

.notice {
padding-bottom: 10px;
Expand All @@ -289,24 +338,9 @@ body {
}

#adminContent_main {
display: block;
overflow: hidden;
width: 74%;
float: right;
min-height: 300px;

.form_horizontal_item {
margin-right: 1em;
}

.setting-content {}

}

&.column_2 {
#adminContent_main {
width: 100%;
}
}

&_main {
Expand Down Expand Up @@ -354,12 +388,6 @@ body {
}

.adminSub {
display: block;
overflow: hidden;
width: 24%;
float: right;
padding-bottom: 10px;

.infoBox {
display: block;
overflow: hidden;
Expand Down
64 changes: 34 additions & 30 deletions inc/vk-admin/package/class-vk-admin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/*
このファイルの元ファイルは
https://github.com/vektor-inc/vektor-wp-libraries
Expand All @@ -11,13 +10,13 @@

if ( ! class_exists( 'Vk_Admin' ) ) {
/*
congif.phpの方で既に ! class_exists( 'Vk_Admin' ) しているが
congif.phpの方で既に ! class_exists( 'Vk_Admin' ) しているが
今後読み込みファイルが増えた時にVk-Adminの中で別のファイルを読み込むために
このファイルにも更にclass_exists( 'Vk_Admin' ) がある。
*/
class Vk_Admin {

public static $version = '2.2.0';
public static $version = '2.6.0';

static function init() {
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_common_css' ) );
Expand Down Expand Up @@ -406,12 +405,14 @@ public static function admin_sub() {
if ( ! $display ) {
return;
}
$adminSub = '<div class="adminSub scrTracking">' . "\n";
$adminSub = '<div class="adminSub">' . "\n";
$adminSub .= '<div class="adminSub_inner">' . "\n";
if ( 'ja' == get_locale() ) {
$adminSub .= '<div class="infoBox">' . self::get_news_body() . '</div>' . "\n";
}
$adminSub .= '<div class="vk-admin-banner">' . self::get_admin_banner() . '</div>' . "\n";

$adminSub .= '</div><!-- [ /.adminSub_inner ] -->' . "\n";
$adminSub .= '</div><!-- [ /.adminSub ] -->' . "\n";
return $adminSub;
}
Expand All @@ -422,37 +423,40 @@ public static function admin_sub() {
public static function admin_page_frame( $get_page_title, $the_body_callback, $get_logo_html = '', $get_menu_html = '', $get_layout = 'column_3' ) {
?>
<div class="wrap vk_admin_page">

<div class="adminMain <?php echo $get_layout; ?>">

<?php if ( $get_layout == 'column_3' ) : ?>
<div id="adminContent_sub" class="scrTracking adminMain_sub">
<?php if ( $get_layout == 'column_2' ) : ?>
<div class="pageLogo"><?php echo $get_logo_html; ?></div>
<?php if ( $get_page_title ) : ?>
<h2 class="page_title"><?php echo $get_page_title; ?></h2>
<?php endif; ?>
<div class="vk_option_nav">
<ul>
<?php echo $get_menu_html; ?>
</ul>
</div>
</div><!-- [ /#adminContent_sub ] -->
<?php endif; ?>

<?php if ( $get_layout == 'column_2' ) : ?>
<div class="pageLogo"><?php echo $get_logo_html; ?></div>
<?php if ( $get_page_title ) : ?>
<?php if ( $get_page_title ) : ?>
<h1 class="page_title"><?php echo $get_page_title; ?></h1>
<?php endif; ?>
<?php endif; ?>

<div id="adminContent_main" class="adminMain_main">
<?php call_user_func_array( $the_body_callback, array() ); ?>
</div><!-- [ /#adminContent_main ] -->

</div><!-- [ /.adminMain ] -->

<?php echo self::admin_sub(); ?>
<div class="adminLayout">
<div class="adminMain <?php echo $get_layout; ?>">

<?php if ( $get_layout == 'column_3' ) : ?>
<div id="adminContent_sub" class="scrTracking adminMain_sub">
<div class="adminMain_sub_inner">
<div class="pageLogo"><?php echo $get_logo_html; ?></div>
<?php if ( $get_page_title ) : ?>
<h2 class="page_title"><?php echo $get_page_title; ?></h2>
<?php endif; ?>
<div class="vk_option_nav">
<ul>
<?php echo $get_menu_html; ?>
</ul>
</div>
</div>
</div><!-- [ /#adminContent_sub ] -->
<?php endif; ?>

<div id="adminContent_main" class="adminMain_main">
<?php call_user_func_array( $the_body_callback, array() ); ?>
</div><!-- [ /#adminContent_main ] -->

</div><!-- [ /.adminMain ] -->

<?php echo self::admin_sub(); ?>
</div>

</div><!-- [ /.vkExUnit_admin_page ] -->
<?php
Expand Down
Loading