Widget: Avoid adding extra spaces to the result of this._classes(...)

This is a PR on top of a PR (#1369).
Why can't this just be `if ( classes[ parts[ i ] ] )`?