Lightning Advanced Unit - Version 2.6.1

Version Description

  • [ bug fix ] Add processing when there is no sidebar.
Download this release

Release Info

Developer kurudrive
Plugin Icon wp plugin Lightning Advanced Unit
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6.0 to 2.6.1

js/lightning-adv.js CHANGED
@@ -139,6 +139,11 @@ function run_menuResize(){
139
 
140
  });
141
  jQuery(window).scroll(function(){
 
 
 
 
 
142
  sideFix_scroll();
143
  });
144
 
@@ -155,8 +160,6 @@ function run_menuResize(){
155
  /*-------------------------------------------*/
156
  function sideFix_scroll(){
157
 
158
- if( !$('body').hasClass('sidebar-fix') ){ return; }
159
-
160
  // 画面の幅を取得
161
  var wrap_width = $('body').width();
162
  // 画面の高を取得
139
 
140
  });
141
  jQuery(window).scroll(function(){
142
+ if( !$('body').hasClass('sidebar-fix') ){ return; }
143
+ // サイドバーの位置を取得
144
+ var sidebar_position_now = jQuery('.sideSection').offset();
145
+ // サイドバーがなかったら処理中止
146
+ if ( !sidebar_position_now ) { return }
147
  sideFix_scroll();
148
  });
149
 
160
  /*-------------------------------------------*/
161
  function sideFix_scroll(){
162
 
 
 
163
  // 画面の幅を取得
164
  var wrap_width = $('body').width();
165
  // 画面の高を取得
js/lightning-adv.min.js CHANGED
@@ -7,8 +7,9 @@ function slide_menu_open(menuPosition){var navSection_open_position='navSection_
7
  function slide_menu_close(menuPosition){if(!menuPosition){if(jQuery('#navSection').hasClass('navSection_open_right')){menuPosition='right';}else{menuPosition='left';}}
8
  var wrap_width=jQuery('body').width();jQuery('#bodyInner').css({"width":wrap_width});jQuery('#wrap').css({"width":wrap_width});var menu_width=wrap_width-60+'px';jQuery('#wrap').stop().animate({"margin-left":"0"},200);jQuery('header.siteHeader').stop().animate({"left":"0"},200);if(menuPosition=='right'){jQuery('header.siteHeader').stop().animate({"left":"0"},200);jQuery('#navSection').stop().animate({"right":"-"+menu_width},200,function(){menuClose_common();});}else if(menuPosition=='left'){jQuery('#navSection').stop().animate({"left":"-"+menu_width},200,function(){menuClose_common();});}}
9
  function menuClose_common(){jQuery('#navSection').removeClass('navSection_open_right');jQuery('#navSection').removeClass('navSection_open_left');jQuery('#navSection').css({"right":"","left":"","display":""});jQuery('#headerTop').prependTo('header.siteHeader');jQuery('#bodyInner').css({"width":""});jQuery('#wrap').css({"width":""});if(jQuery('#navSection').is(':animated')){jQuery('#gMenu_outer').insertAfter('.navbar-header');}}
10
- function run_menuResize(){var wrap_width=jQuery('body').width();jQuery('#bodyInner').css({"width":wrap_width});var headerHeight=jQuery('header.siteHeader').height;jQuery('#top__fullcarousel').css({"margin-top":headerHeight});if(wrap_width>991){slide_menu_close();}};(function($){jQuery(document).ready(function(){});jQuery(window).resize(function(){});jQuery(window).scroll(function(){sideFix_scroll();});function sideFix_reset(){jQuery('.sideSection').css({"margin-top":""});}
11
- function sideFix_scroll(){if(!$('body').hasClass('sidebar-fix')){return;}
12
- var wrap_width=$('body').width();var window_height=document.documentElement.clientHeight;if(wrap_width<992){sideFix_reset()}else{var sidebar_position_now=jQuery('.sideSection').offset();var content_position_now=jQuery('.mainSection').offset();var sidebar_height=jQuery('.sideSection').outerHeight();var content_height=jQuery('.mainSection').outerHeight();var height_difference=content_height-sidebar_height;var sidebar_bottom_position_default=content_position_now['top']+sidebar_height;var content_bottom_position_default=content_position_now['top']+content_height;var sidebar_bottom_position_now=sidebar_position_now['top']+sidebar_height;var content_bottom_position_now=content_position_now['top']+content_height;if(window_height<sidebar_bottom_position_default){var sidebar_over_size=sidebar_bottom_position_default-window_height;var sidebar_over_size_start=sidebar_height-window_height;if(sidebar_height>window_height){var move_position_start=content_position_now['top']+sidebar_over_size_start+30;var move_position_end=height_difference+content_position_now['top']+sidebar_over_size_start+30;}else{var move_position_start=content_position_now['top'];var move_position_end=height_difference+content_position_now['top'];}}else{var move_position_start=content_position_now['top'];var move_position_end=height_difference+content_position_now['top'];}
 
13
  if(sidebar_height>content_height){return;}
14
  var scrollHeight=window.pageYOffset;if(scrollHeight<move_position_start){sideFix_reset();}else{if(scrollHeight<move_position_end){var yohaku=scrollHeight-move_position_start;jQuery('.sideSection').css({"margin-top":yohaku});}else{var yohaku=content_height-sidebar_height;jQuery('.sideSection').css({"margin-top":yohaku});}}}}})(jQuery);
7
  function slide_menu_close(menuPosition){if(!menuPosition){if(jQuery('#navSection').hasClass('navSection_open_right')){menuPosition='right';}else{menuPosition='left';}}
8
  var wrap_width=jQuery('body').width();jQuery('#bodyInner').css({"width":wrap_width});jQuery('#wrap').css({"width":wrap_width});var menu_width=wrap_width-60+'px';jQuery('#wrap').stop().animate({"margin-left":"0"},200);jQuery('header.siteHeader').stop().animate({"left":"0"},200);if(menuPosition=='right'){jQuery('header.siteHeader').stop().animate({"left":"0"},200);jQuery('#navSection').stop().animate({"right":"-"+menu_width},200,function(){menuClose_common();});}else if(menuPosition=='left'){jQuery('#navSection').stop().animate({"left":"-"+menu_width},200,function(){menuClose_common();});}}
9
  function menuClose_common(){jQuery('#navSection').removeClass('navSection_open_right');jQuery('#navSection').removeClass('navSection_open_left');jQuery('#navSection').css({"right":"","left":"","display":""});jQuery('#headerTop').prependTo('header.siteHeader');jQuery('#bodyInner').css({"width":""});jQuery('#wrap').css({"width":""});if(jQuery('#navSection').is(':animated')){jQuery('#gMenu_outer').insertAfter('.navbar-header');}}
10
+ function run_menuResize(){var wrap_width=jQuery('body').width();jQuery('#bodyInner').css({"width":wrap_width});var headerHeight=jQuery('header.siteHeader').height;jQuery('#top__fullcarousel').css({"margin-top":headerHeight});if(wrap_width>991){slide_menu_close();}};(function($){jQuery(document).ready(function(){});jQuery(window).resize(function(){});jQuery(window).scroll(function(){if(!$('body').hasClass('sidebar-fix')){return;}
11
+ var sidebar_position_now=jQuery('.sideSection').offset();if(!sidebar_position_now){return}
12
+ sideFix_scroll();});function sideFix_reset(){jQuery('.sideSection').css({"margin-top":""});}
13
+ function sideFix_scroll(){var wrap_width=$('body').width();var window_height=document.documentElement.clientHeight;if(wrap_width<992){sideFix_reset()}else{var sidebar_position_now=jQuery('.sideSection').offset();var content_position_now=jQuery('.mainSection').offset();var sidebar_height=jQuery('.sideSection').outerHeight();var content_height=jQuery('.mainSection').outerHeight();var height_difference=content_height-sidebar_height;var sidebar_bottom_position_default=content_position_now['top']+sidebar_height;var content_bottom_position_default=content_position_now['top']+content_height;var sidebar_bottom_position_now=sidebar_position_now['top']+sidebar_height;var content_bottom_position_now=content_position_now['top']+content_height;if(window_height<sidebar_bottom_position_default){var sidebar_over_size=sidebar_bottom_position_default-window_height;var sidebar_over_size_start=sidebar_height-window_height;if(sidebar_height>window_height){var move_position_start=content_position_now['top']+sidebar_over_size_start+30;var move_position_end=height_difference+content_position_now['top']+sidebar_over_size_start+30;}else{var move_position_start=content_position_now['top'];var move_position_end=height_difference+content_position_now['top'];}}else{var move_position_start=content_position_now['top'];var move_position_end=height_difference+content_position_now['top'];}
14
  if(sidebar_height>content_height){return;}
15
  var scrollHeight=window.pageYOffset;if(scrollHeight<move_position_start){sideFix_reset();}else{if(scrollHeight<move_position_end){var yohaku=scrollHeight-move_position_start;jQuery('.sideSection').css({"margin-top":yohaku});}else{var yohaku=content_height-sidebar_height;jQuery('.sideSection').css({"margin-top":yohaku});}}}}})(jQuery);
lightning_advanced_unit.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Lightning Advanced Unit
4
  * Plugin URI: http://lightning.vektor-inc.co.jp/
5
- * Version: 2.6.0
6
  * Author: Vektor,Inc.
7
  * Author URI: http://www.vektor-inc.co.jp
8
  * Description: This is a plug-ins that extend the functionality of the theme "Lightning".
@@ -14,7 +14,7 @@
14
 
15
  $template = get_option('template');
16
 
17
- if ( $template == 'lightning' ){
18
 
19
  $data = get_file_data( __FILE__, array( 'version' => 'Version','textdomain' => 'Text Domain' ) );
20
  define( 'LIGHTNING_ADVANCED_VERSION', $data['version'] );
@@ -49,8 +49,6 @@ function lightning_adv_unit_textdomain() {
49
  }
50
  add_action( 'plugins_loaded', 'lightning_adv_unit_textdomain' );
51
 
52
- } // if ( $template == 'lightning' ){
53
-
54
  /*-------------------------------------------*/
55
  /* Load js & CSS
56
  /*-------------------------------------------*/
2
  /**
3
  * Plugin Name: Lightning Advanced Unit
4
  * Plugin URI: http://lightning.vektor-inc.co.jp/
5
+ * Version: 2.6.1
6
  * Author: Vektor,Inc.
7
  * Author URI: http://www.vektor-inc.co.jp
8
  * Description: This is a plug-ins that extend the functionality of the theme "Lightning".
14
 
15
  $template = get_option('template');
16
 
17
+ if ( ! ( $template == 'lightning' || $template == 'Lightning' ) ) return;
18
 
19
  $data = get_file_data( __FILE__, array( 'version' => 'Version','textdomain' => 'Text Domain' ) );
20
  define( 'LIGHTNING_ADVANCED_VERSION', $data['version'] );
49
  }
50
  add_action( 'plugins_loaded', 'lightning_adv_unit_textdomain' );
51
 
 
 
52
  /*-------------------------------------------*/
53
  /* Load js & CSS
54
  /*-------------------------------------------*/
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: Lightning,
5
  Requires at least: 4.5
6
  Tested up to: 4.9.1
7
- Stable tag: 2.6.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -44,6 +44,9 @@ e.g.
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 2.6.0 =
48
  * [ Add function ] sidebar fix
49
 
4
  Tags: Lightning,
5
  Requires at least: 4.5
6
  Tested up to: 4.9.1
7
+ Stable tag: 2.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
44
 
45
  == Changelog ==
46
 
47
+ = 2.6.1 =
48
+ * [ bug fix ] Add processing when there is no sidebar.
49
+
50
  = 2.6.0 =
51
  * [ Add function ] sidebar fix
52