Skip to content

Commit

Permalink
Tabs: Allow non-latin characters for ids. Fixes #4581 - title attribu…
Browse files Browse the repository at this point in the history
…te for remote tabs does not support foreign languages.
  • Loading branch information
scottgonzalez committed Sep 3, 2010
1 parent ddb9a78 commit 78540e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/unit/tabs/tabs.html
Expand Up @@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
<li><a href="#colon:test"><span>1</span></a></li>
<li><a href="#inline-style"><span>2</span></a></li>
<li><a href="data/test.html#test"><span>3</span></a></li>
<li><a href="data/test.html" title="∫ßáö Սե"<span>4</span></a></li>
</ul>
<div id="colon:test"></div>
<div style="height: 300px;" id="inline-style"></div>
Expand Down
12 changes: 11 additions & 1 deletion tests/unit/tabs/tabs_tickets.js
Expand Up @@ -70,7 +70,6 @@ test('#5069 - ui.tabs.add creates two tab panels when using a full URL', functio

});


test('#5893 - Sublist in the tab list are considered as tab', function() {
// http://dev.jqueryui.com/ticket/5893
expect(1);
Expand All @@ -80,5 +79,16 @@ test('#5893 - Sublist in the tab list are considered as tab', function() {

});

asyncTest( "#4581 - title attribute for remote tabs does not support foreign languages", function() {
expect( 1 );

$( "#tabs2" ).tabs({
selected: 3,
load: function( event, ui ) {
equal( ui.panel.id, "∫ßáö_Սե", "proper title" );
start();
}
});
});

})(jQuery);
2 changes: 1 addition & 1 deletion ui/jquery.ui.tabs.js
Expand Up @@ -63,7 +63,7 @@ $.widget( "ui.tabs", {
},

_tabId: function( a ) {
return a.title && a.title.replace( /\s/g, "_" ).replace( /[^A-Za-z0-9\-_:\.]/g, "" ) ||
return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
this.options.idPrefix + getNextTabId();
},

Expand Down

0 comments on commit 78540e2

Please sign in to comment.