jQuery-EasyTabs icon indicating copy to clipboard operation
jQuery-EasyTabs copied to clipboard

Possible conflict with backbone.js

Open grinfax opened this issue 14 years ago • 7 comments

I am trying to use backbone.js along with easyTabs and there seems to be a conflict on the click event. I get no errors, it just seems like backbone is highjacking the click event from easyTabs.

grinfax avatar Nov 04 '11 17:11 grinfax

Have you been able to figure this out? I'd like to close this issue if possible, or if no one else has seen this issue.

JangoSteve avatar Jan 22 '12 20:01 JangoSteve

I'm pretty sure that I just ran into the same issue. No errors whatsoever, but the behavior gets overwritten by backbone.

elea avatar Feb 10 '12 00:02 elea

That's sound to be my case too.. I have no errors and when I refresh my page with the anchor, it'll open it with the exact tab I wanted.. But it just don't change on click.. Have you found something about this case?

mathvallee avatar Apr 17 '12 08:04 mathvallee

Easytab uses the # notation to trigger the display of tabs. The # notation is also used by backbone to trigger routes. So when you click a tab with easytab, it is interpreted by backbone as a routing event.

That's why you have no error logged in the console. This is a design issue, not a JS error.

ndelaforge avatar Oct 14 '14 12:10 ndelaforge

@ndelaforge Thanks for the info. I don't use backbone much. Do you know if there's a way to tell backbone to ignore links?

jQuery Mobile is one example off the top of my head that does something like this, where you can add rel=external or data-ajax=false to links to tell jQuery Mobile to ignore them and not intercept their click events.

JangoSteve avatar Oct 14 '14 14:10 JangoSteve

The only way I know to avoid BackboneJS trigger the router is to pass "javscript:void(0)" into the href. I tried to do it with easytabs, but it was sending me an error about empty links.

I think Easytabs should permit the use of empty links to be compliant with MVC frameworks. For instance Bootstrap allows the use of an alternative attribute (data-target) to trigger the tab display. http://getbootstrap.com/javascript/#tabs

ndelaforge avatar Oct 14 '14 14:10 ndelaforge

i have a similar problem with select2 jquery(it add autocomplete for select list) It is not avaliable(just a normal select list appear) until press F5 on the tab page. i thought that the problem was because of the document.ready but not at all.

Avemaar avatar Oct 21 '14 16:10 Avemaar