Giter Site home page Giter Site logo

Comments (10)

dmorrison avatar dmorrison commented on August 15, 2024 1

I would like to see this feature implemented too. Thanks for the useful plugin!

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

Can you please explain me what you want to achieve?

from sidebar.

sdkcarlos avatar sdkcarlos commented on August 15, 2024

Hide or show the sidebar without user interaction a Method like showSidebar and hideSidebar. This sidebar is very useful and i need to trigger these actions without user interaction

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

By now there isn't such feature. I guess you should think of a trick by yourself.
However I will consider to add a feature like this in the next version of this plugin!

from sidebar.

sdkcarlos avatar sdkcarlos commented on August 15, 2024

A quick & dirty solution for who need this too is to hide the opener with css and trigger the click event with jQuery : $("#opener").trigger("click");

Thanks for take the time to answer !

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

@sdkcarlos can you please provide me some examples? Like the way you did this trick and when did you call that method?
I am willing to add this options so I am rewriting the plugin, it will be awesome if you'd explain me your situation!

from sidebar.

sdkcarlos avatar sdkcarlos commented on August 15, 2024

I mean, for example : I have an asynchronous call (ajax) and it will get some data from the server , when this data is fetched I need to open the sidebar with pure javascript !

We need actually to open the bar ,click on the given selector :

selector.simplerSidebar({opener:'#otherselector'});

screenshot_2016-02-21-10-24-58

I used this plugin in Our Code Editor Free, an android app so in the simple case , a normal initialization worked.

But in other project I needed to trigger the bar when the akax call finished so I simply used :

$("#otherselector").trigger("click");

That did the trick for me , with the actual source Code of your project , a good possible fix to this is add some option like :

selector.simplerSidebar("show");

When executed, check if the plugins has been already initializated on the selector and show the bar, otherwise initalize it.
However this is just a suggestion and the plugin is working very well, with the trigger function the problem is solved (if someone needs the same Feature).

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

This sounds a little complicated to me, but I will think of how to implement this feature!

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

This is painful using the jquery plugin pattern. And since other patterns I tested lack of the ability to run truly multiple instances, I think that by triggering the click like you did is the best option!

I won't close this issue because I really committed to find the way that can coexist with jquery!

from sidebar.

ctrlmaniac avatar ctrlmaniac commented on August 15, 2024

The only smart way to toggle the animation is by triggering the trigger like @sdkcarlos did!

from sidebar.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.