From 2434dfd45d0805304e1db634d059feaa0bacf358 Mon Sep 17 00:00:00 2001 From: Hrvoje Novosel Date: Wed, 15 Jul 2020 16:10:20 +0200 Subject: [PATCH] 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 --- ui/widget.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/widget.js b/ui/widget.js index 30034f592..4b5871205 100644 --- a/ui/widget.js +++ b/ui/widget.js @@ -717,6 +717,8 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; + } else if ( options === true ) { + options = {}; } hasOptions = !$.isEmptyObject( options ); -- 2.39.5