Skip to content

Commit

Permalink
jquery-ui: BTD support 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ashensis committed Jun 13, 2017
1 parent 254fd68 commit cb09255
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ $.Widget.prototype = {
_getTextDir: function( text ) {
if ( this.options.textDir === "auto" ) {

// Look for first strong (either English or Arabic/Hebrew) character
// Resolve text direction accordingly ("rtl" for Arabic/Hebrew, "ltr" otherwise)
// Look for first strong (either English or Arabic/Hebrew) character.
// Resolve text direction accordingly ("rtl" for Arabic/Hebrew, "ltr" otherwise).
var matcher = /[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec( text );
return ( matcher && ( matcher[ 0 ] > "z" ) ) ? "rtl" : "ltr";
}
Expand All @@ -714,8 +714,8 @@ $.Widget.prototype = {
if ( typeof param === "string" ) {
param = param.replace( /[\u202A\u202B\u202C]/g, "" );

// Unicode directional characters: 202A and 202B used to enforce text direction
// 202C - POP formatter closing directional segment
// Unicode directional characters: 202A and 202B used to enforce text direction.
// 202C - POP formatter closing directional segment.
return ( this._getTextDir( param ) === "rtl" ? "\u202B" : "\u202A" ) + param + "\u202C";
} else if ( param.jquery ) {
var isField = param.is( "input" ) || param.is( "textarea" );
Expand Down

0 comments on commit cb09255

Please sign in to comment.