Skip to content

Commit ea5e492

Browse files
author
Gabriel Schulhof
committed
Widget: Avoid adding extra spaces to the result of this._classes(...)
Closes gh-1372
1 parent 75efe38 commit ea5e492

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ui/widget.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ $.Widget.prototype = {
410410

411411
while ( i-- ) {
412412
out.push( parts[ i ] );
413-
out.push( classes[ parts[ i ] ] );
413+
414+
// Avoid extra spaces in the return value resulting from pushing an empty classes value
415+
if ( classes[ parts[ i ] ] ) {
416+
out.push( classes[ parts[ i ] ] );
417+
}
414418
}
415419

416420
return out.join( " " );

0 commit comments

Comments
 (0)