Skip to content

Commit a8c7d2e

Browse files
authored
v0.5.4 - Merge pull request #71 from JoryHogeveen/dev
v0.5.4
2 parents 8b0e084 + 6ce7fdc commit a8c7d2e

19 files changed

+311
-237
lines changed

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"name": "JoryHogeveen/off-canvas-sidebars",
33
"type": "wordpress-plugin",
44
"description": "Add off-canvas sidebars using the Slidebars jQuery plugin",
5-
"keywords": [],
5+
"keywords": [
6+
"wordpress",
7+
"off-canvas-sidebars",
8+
"canvas",
9+
"mobile menu",
10+
"slidebars"
11+
],
612
"homepage": "https://github.com/JoryHogeveen/off-canvas-sidebars/",
713
"license": "GPL-2.0+",
814
"authors": [

css/off-canvas-sidebars-admin.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author Jory Hogeveen <[email protected]>
55
* @package Off_Canvas_Sidebars
66
* @since 0.2.0
7-
* @version 0.5.0
7+
* @version 0.5.4
88
* @preserve
99
*/
1010

@@ -16,6 +16,7 @@
1616
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
1717
}
1818

19+
.ocs-credits .inside { padding: 0; margin: 0; }
1920
.ocs-credits .inner { padding-left: 10px; padding-right: 10px; }
2021
.ocs-credits h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; border-bottom: 1px solid #eee; }
2122

css/off-canvas-sidebars-admin.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/off-canvas-sidebars.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author Jory Hogeveen <[email protected]>
55
* @package Off_Canvas_Sidebars
66
* @since 0.2.0
7-
* @version 0.5.0
7+
* @version 0.5.4
88
* @preserve
99
*/
1010

@@ -32,6 +32,21 @@ html.ocs-scroll-lock.ocs-scroll-fixed body {
3232
.ocs-initialized [canvas=container] {
3333
overflow-y: hidden;
3434
height: auto;
35+
min-height: 100vh;
36+
}
37+
38+
.admin-bar [canvas=container] {
39+
min-height: -webkit-calc( 100vh - 32px );
40+
min-height: -moz-calc( 100vh - 32px );
41+
min-height: calc( 100vh - 32px );
42+
}
43+
44+
@media screen and (max-width: 782px) {
45+
.admin-bar [canvas=container] {
46+
min-height: -webkit-calc( 100vh - 46px );
47+
min-height: -moz-calc( 100vh - 46px );
48+
min-height: calc( 100vh - 46px );
49+
}
3550
}
3651

3752

css/off-canvas-sidebars.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/class-frontend.php

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @author Jory Hogeveen <[email protected]>
1717
* @package Off_Canvas_Sidebars
1818
* @since 0.1.0
19-
* @version 0.5.3
19+
* @version 0.5.4
2020
* @uses \OCS_Off_Canvas_Sidebars_Base Extends class
2121
*/
2222
final class OCS_Off_Canvas_Sidebars_Frontend extends OCS_Off_Canvas_Sidebars_Base
@@ -74,8 +74,12 @@ private function default_actions() {
7474
$after_hook = trim( $this->get_settings( 'website_after_hook' ) );
7575

7676
if ( 'genesis' === get_template() ) {
77-
$before_hook = 'genesis_before';
78-
$after_hook = 'genesis_after';
77+
if ( empty( $before_hook ) ) {
78+
$before_hook = 'genesis_before';
79+
}
80+
if ( empty( $after_hook ) ) {
81+
$after_hook = 'genesis_after';
82+
}
7983
} else {
8084
if ( empty( $before_hook ) ) {
8185
$before_hook = 'website_before';
@@ -248,7 +252,7 @@ public function do_sidebar( $sidebar_id ) {
248252
/**
249253
* Filter nav menu args.
250254
*
251-
* Please note that the theme_location property will be overwritten!
255+
* Please note that the `theme_location` and `echo` properties will be overwritten!
252256
*
253257
* @since 0.3.0
254258
*
@@ -259,9 +263,9 @@ public function do_sidebar( $sidebar_id ) {
259263
* @param string $sidebar_id The ID of this sidebar as configured in: Appearance > Off-Canvas Sidebars > Sidebars.
260264
* @param array $sidebar_data The sidebar settings.
261265
*/
262-
apply_filters( 'ocs_wp_nav_menu_args', $args, $sidebar_id, $sidebar_data );
266+
$args = apply_filters( 'ocs_wp_nav_menu_args', $args, $sidebar_id, $sidebar_data );
263267

264-
// Force the set theme location.
268+
// Force the theme location.
265269
$args['theme_location'] = 'off-canvas-' . $sidebar_id;
266270
// Force echo.
267271
$args['echo'] = true;
@@ -352,7 +356,7 @@ public function get_container_attributes() {
352356
'id' => $this->get_settings( 'css_prefix' ) . '-site',
353357
'canvas' => 'container',
354358
'data-ocs-site_close' => (bool) $this->get_settings( 'site_close' ),
355-
'data-ocs-disable_over' => (int) $this->get_settings( 'disable_over' ),
359+
'data-ocs-disable_over' => (int) $this->get_settings( 'disable_over' ),
356360
'data-ocs-hide_control_classes' => (bool) $this->get_settings( 'hide_control_classes' ),
357361
'data-ocs-scroll_lock' => (bool) $this->get_settings( 'scroll_lock' ),
358362
);
@@ -379,8 +383,10 @@ public function get_sidebar_attributes( $sidebar_id, $data ) {
379383
$atts['class'] = array();
380384
$atts['class'][] = $prefix . '-slidebar';
381385
$atts['class'][] = $prefix . '-' . $sidebar_id;
382-
$atts['class'][] = 'ocs-slidebar';
383-
$atts['class'][] = 'ocs-' . $sidebar_id;
386+
if ( 'ocs' !== $prefix ) {
387+
$atts['class'][] = 'ocs-slidebar';
388+
$atts['class'][] = 'ocs-' . $sidebar_id;
389+
}
384390
$atts['class'][] = 'ocs-size-' . $data['size'];
385391
$atts['class'][] = 'ocs-location-' . $data['location'];
386392
$atts['class'][] = 'ocs-style-' . $data['style'];
@@ -443,7 +449,7 @@ public function do_control_trigger( $sidebar_id, $args = array() ) {
443449
public function add_styles_scripts() {
444450

445451
// @todo Validate and use minified files
446-
$suffix = '';//defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
452+
$suffix = '';//defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
447453
$version = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? time() : OCS_PLUGIN_VERSION;
448454

449455
// FastClick library https://github.com/ftlabs/fastclick
@@ -467,17 +473,21 @@ public function add_styles_scripts() {
467473
$sidebars[ $sidebar_id ] = $sidebar_data;
468474
}
469475
}
470-
wp_localize_script( 'off-canvas-sidebars', 'ocsOffCanvasSidebars', array(
471-
'site_close' => (bool) $this->get_settings( 'site_close' ),
472-
'link_close' => (bool) $this->get_settings( 'link_close' ),
473-
'disable_over' => (int) $this->get_settings( 'disable_over' ),
474-
'hide_control_classes' => (bool) $this->get_settings( 'hide_control_classes' ),
475-
'scroll_lock' => (bool) $this->get_settings( 'scroll_lock' ),
476-
'legacy_css' => (bool) ( 'legacy-css' === $this->get_settings( 'compatibility_position_fixed' ) ),
477-
'css_prefix' => $this->get_settings( 'css_prefix' ),
478-
'sidebars' => $sidebars,
479-
'_debug' => (bool) ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
480-
) );
476+
wp_localize_script(
477+
'off-canvas-sidebars',
478+
'ocsOffCanvasSidebars',
479+
array(
480+
'site_close' => (bool) $this->get_settings( 'site_close' ),
481+
'link_close' => (bool) $this->get_settings( 'link_close' ),
482+
'disable_over' => (int) $this->get_settings( 'disable_over' ),
483+
'hide_control_classes' => (bool) $this->get_settings( 'hide_control_classes' ),
484+
'scroll_lock' => (bool) $this->get_settings( 'scroll_lock' ),
485+
'legacy_css' => (bool) ( 'legacy-css' === $this->get_settings( 'compatibility_position_fixed' ) ),
486+
'css_prefix' => $this->get_settings( 'css_prefix' ),
487+
'sidebars' => $sidebars,
488+
'_debug' => (bool) ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
489+
)
490+
);
481491
}
482492

483493
/**

0 commit comments

Comments
 (0)