mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: Fixed IE bug which would mistake tabs as ajax with dynamically created HTML, fixes #4033
This commit is contained in:
parent
1866e1382f
commit
c8360e619b
@ -263,6 +263,17 @@ module('tabs: Tickets');
|
||||
|
||||
});
|
||||
|
||||
test('IE expands hash to full url and misinterprets tab as ajax, #4033', function() { // http://ui.jquery.com/bugs/ticket/4033
|
||||
expect(1);
|
||||
|
||||
el = $('<div><ul><li><a href="#tab">Tab</a></li></ul><div id="tab"></div></div>')
|
||||
.appendTo('#main').tabs();
|
||||
|
||||
equals($('a', el).data('load.tabs'), undefined, 'should not create ajax tab');
|
||||
|
||||
});
|
||||
|
||||
|
||||
// test('', function() {
|
||||
// expect(0);
|
||||
//
|
||||
|
@ -63,6 +63,10 @@ $.widget("ui.tabs", {
|
||||
this.$tabs.each(function(i, a) {
|
||||
var href = $(a).attr('href');
|
||||
|
||||
// For dynamically created HTML that contains a hash as href IE expands
|
||||
// such href to the full page url with hash and then misinterprets tab as ajax...
|
||||
if (href.split('#')[0] == location.toString().split('#')[0]) href = a.hash;
|
||||
|
||||
// inline tab
|
||||
if (fragmentId.test(href))
|
||||
self.$panels = self.$panels.add(self._sanitizeSelector(href));
|
||||
|
Loading…
Reference in New Issue
Block a user