Widget: Fix boolean option when under use strict

Fix for `options === true` when using jQuery UI under `use strict`,
which throws:
```
Uncaught TypeError: Cannot create property 'complete' on boolean 'true'
```
on line:
```js
options.complete = callback;
```

Closes gh-1931
This commit is contained in:
Hrvoje Novosel 2020-07-15 16:10:20 +02:00 committed by Michał Gołębiowski-Owczarek
parent 6bf38048f3
commit 2434dfd45d

View File

@ -717,6 +717,8 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
options = options || {}; options = options || {};
if ( typeof options === "number" ) { if ( typeof options === "number" ) {
options = { duration: options }; options = { duration: options };
} else if ( options === true ) {
options = {};
} }
hasOptions = !$.isEmptyObject( options ); hasOptions = !$.isEmptyObject( options );