teijo / jquery-bracket

jQuery Bracket library for organizing single and double elimination tournaments
http://aropupu.fi/bracket/
MIT License
484 stars 253 forks source link

Binding carousel slide changes to bracket clicking events #35

Open ciprianflorescu opened 9 years ago

ciprianflorescu commented 9 years ago

Thanks for writing this plugin. It has been very useful for our tournament.

I have been working on mixing brackets created with this plugin with an Owl carousel, which would serve different content in slides on top of the brackets. So, the behaviour I'm trying to get is this: A match is clicked in the brackets => the carousel jumps to a video or slide with information.

However, I noticed that the function which handles onclick events is only used for editing text or displaying some match data. Is it possible to make the matches divs behave like links? I would need to use those links for callbacks for the carousel slides.

I have tried a few things until now, such as appending links in a div which are created using data from the match information (from the brackets array). That's not a great solution, though, since it's a 2-step process to first create the links and then click them to have content displayed in the carousel. I've also tried to use jQuery to identify these newly created links and to trigger click events on them, but again, for some reason it doesn't work.

So is there any way to make the brackets divs behave like links which can have a href attribute and be used for callbacks in another plugin?

ciprianflorescu commented 9 years ago

Here is an example of how I want this to work:

http://jsfiddle.net/EwFMn/9/

The brackets would be displayed under the carousel. The problem is all my attempts to use jQuery to make onclick events on the brackets to trigger displaying a certain slide in the carousel didn't work. I was wondering if the brackets built-in onclick function can support such a behaviour.

teijo commented 9 years ago

You might be best to just fork the project and make some edits to the edit handling. It's currently not configurable.