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

sidebar-mini init page #40

Closed
ricardocarrer opened this issue Mar 15, 2019 · 9 comments
Closed

sidebar-mini init page #40

ricardocarrer opened this issue Mar 15, 2019 · 9 comments

Comments

@ricardocarrer
Copy link

Hi!

When a page with the sidebar-mini and does a toggle to show, the scrool goes wrong.

Add the below line 134:

sidebar_nicescroll.remove ();
sidebar_nicescroll = null;

Correct?

tks

@ricardocarrer
Copy link
Author

Did not work :(

@nauvalazhar
Copy link
Member

And why you closed this issue? 😆

@ricardocarrer
Copy link
Author

When it starts with the sidebar-mini it gets sidebar_nicescroll active and does not add the tooltip in the single menu. When it expands, the sidebar_nicescroll gets broken, it does not stay the same width as the sidebar. I tried to make some adjustments, but I did not succeed.

Sorry for my english (google translator)

@ricardocarrer ricardocarrer reopened this Mar 15, 2019
@ricardocarrer
Copy link
Author

ricardocarrer commented Mar 15, 2019 via email

@ricardocarrer
Copy link
Author

Hi!

I think it was!

Transform in function for add tooltip single menu:
//add RC
var add_tooltip_sidebar_mini = function() {
$(".main-sidebar .sidebar-menu > li").each(function() {
let me = $(this);

  if(me.find('> .dropdown-menu').length) {
    me.find('> .dropdown-menu').hide();
    me.find('> .dropdown-menu').prepend('<li class="dropdown-title pt-3">'+ me.find('> a').text() +'</li>');
  }else{
    me.find('> a').attr('data-toggle', 'tooltip');
    me.find('> a').attr('data-original-title', me.find('> a').text());
    $("[data-toggle='tooltip']").tooltip({
      placement: 'right'
    });
  }
});

}

in else toggle_sidebar_mini:

}else{
body.addClass('sidebar-mini');
body.removeClass('sidebar-show');
sidebar_nicescroll.remove();
sidebar_nicescroll = null;

  //add RC
  add_tooltip_sidebar_mini();
}

in toggleLayout, add other else if:

//Add RC
}else if($("body").hasClass('sidebar-mini')){
add_tooltip_sidebar_mini(); //transform in function
if(sidebar_nicescroll != null) {
sidebar_nicescroll.remove();
}
}else{
update_sidebar_nicescroll();
}

@nauvalazhar
Copy link
Member

Hm, if you want the sidebar-mini as an initial sidebar. Simply you can trigger the toggle button with JavaScript.

$('[data-toggle="sidebar"]').click();

@marcuxyz
Copy link

marcuxyz commented Apr 3, 2019

@ricardocarrer i implemented this. I'm Await an issue be approved.

Please look for this: stisla/docs#5

@ricardocarrer
Copy link
Author

ricardocarrer commented Apr 3, 2019 via email

@marcuxyz
Copy link

marcuxyz commented Apr 5, 2019

This was implemented , now, await the pr stisla/docs#6 . :) @ricardocarrer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants