Yii Framework Forum: Adminlte customization of javascript not working - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adminlte customization of javascript not working control-sidebar (sidebar on right side not pushing content Rate Topic: -----

#1 User is offline   atty 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-February 18

Posted 20 March 2018 - 05:24 AM

my sidebar:
(in frontend/views/layouts/content.php)
 <aside class="control-sidebar control-sidebar-light control-sidebar-open hidden-xs" style="position:fixed">

...
 </aside><div class="control-sidebar-bg  hidden-xs"></div>



Instructions on how to push content instead of slide over:

$("#my-toggle-button").controlSidebar(options);


(https://github.com/a...nLTE/issues/739)

My attempt to follow the instructions:
(in frontend/views/layouts/main.php)
...
   <script>
            // Enable or disable bootstrap tooltips globally, based on touch vs non-touch device
            if( "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch )
            {
                // Touch-screen. Disable tooltips!
                var AdminLTEOptions = {
                    enableBSToppltip: false,
                    [b]controlSidebarOptions[/b]: {slide:false}                    
                };
            }
            else
            {
                // Non-touch-screen. Enable tooltips!
                var AdminLTEOptions = {
                    enableBSToppltip: true,
                    controlSidebarOptions: {slide:false}
                };
            }
        </script>
<?php
    dmstr\web\AdminLteAsset::register($this);

...
(essentially I modify AdminLTEOptions before I load the asset)
based on: https://adminlte.io/...dminlte-options


Problem: It does not work, content is not pushed, but hidden behind the sidebar.


If I hardcode the class 'control-sidebar-open' into the body element the sidebar correcty pushes the content to the left, but as soon as you hide and show the sidebar the class does not magically add it self back to the body element and then the content is hidden parcially behind the right sidebar (control-sidebar)

I could 'hack' it by using javascript to add the class back to the body element each time you show the sidebar again, but I would rather use the actual plugins settings that do this automagically. :-)

Thank you for any help.

ps. Probably not necessary, but here is part of my button code that makes the sidebar show/hide:

id='collapsable-button' data-toggle="control-sidebar"

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users