jquery-ui: BTD support 2

This commit is contained in:
Alex Shensis 2017-06-13 14:41:48 +03:00
parent 254fd68bdc
commit cb092550a8

View File

@ -702,8 +702,8 @@ $.Widget.prototype = {
_getTextDir: function( text ) { _getTextDir: function( text ) {
if ( this.options.textDir === "auto" ) { if ( this.options.textDir === "auto" ) {
// Look for first strong (either English or Arabic/Hebrew) character // Look for first strong (either English or Arabic/Hebrew) character.
// Resolve text direction accordingly ("rtl" for Arabic/Hebrew, "ltr" otherwise) // 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 ); var matcher = /[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec( text );
return ( matcher && ( matcher[ 0 ] > "z" ) ) ? "rtl" : "ltr"; return ( matcher && ( matcher[ 0 ] > "z" ) ) ? "rtl" : "ltr";
} }
@ -714,8 +714,8 @@ $.Widget.prototype = {
if ( typeof param === "string" ) { if ( typeof param === "string" ) {
param = param.replace( /[\u202A\u202B\u202C]/g, "" ); param = param.replace( /[\u202A\u202B\u202C]/g, "" );
// Unicode directional characters: 202A and 202B used to enforce text direction // Unicode directional characters: 202A and 202B used to enforce text direction.
// 202C - POP formatter closing directional segment // 202C - POP formatter closing directional segment.
return ( this._getTextDir( param ) === "rtl" ? "\u202B" : "\u202A" ) + param + "\u202C"; return ( this._getTextDir( param ) === "rtl" ? "\u202B" : "\u202A" ) + param + "\u202C";
} else if ( param.jquery ) { } else if ( param.jquery ) {
var isField = param.is( "input" ) || param.is( "textarea" ); var isField = param.is( "input" ) || param.is( "textarea" );