diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-06-07 00:58:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 00:58:12 +0200 |
commit | 70dae67b73dfea9126f126f516fe8286f1e73417 (patch) | |
tree | e61eafab41ee74330fecf1da2ce125050cfac49b /ui/widgets/resizable.js | |
parent | a12c98574d07f002fd59d166f9fc1fd391581b91 (diff) | |
download | jquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.tar.gz jquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.zip |
Build: Migrate from JSHint & JSCS to ESLint
Fixes #15393
Closes gh-1958
Diffstat (limited to 'ui/widgets/resizable.js')
-rw-r--r-- | ui/widgets/resizable.js | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js index 222c93a5e..13e98c658 100644 --- a/ui/widgets/resizable.js +++ b/ui/widgets/resizable.js @@ -17,6 +17,8 @@ //>>css.theme: ../../themes/base/theme.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -33,7 +35,8 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; $.widget( "ui.resizable", $.ui.mouse, { version: "@VERSION", @@ -91,9 +94,15 @@ $.widget( "ui.resizable", $.ui.mouse, { // TODO: determine which cases actually cause this to happen // if the element doesn't have the scroll set, see if it's possible to // set the scroll - el[ scroll ] = 1; - has = ( el[ scroll ] > 0 ); - el[ scroll ] = 0; + try { + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + } catch ( e ) { + + // `el` might be a string, then setting `scroll` will throw + // an error in strict mode; ignore it. + } return has; }, @@ -776,7 +785,9 @@ $.widget( "ui.resizable", $.ui.mouse, { _propagate: function( n, event ) { $.ui.plugin.call( this, n, [ event, this.ui() ] ); - ( n !== "resize" && this._trigger( n, event, this.ui() ) ); + if ( n !== "resize" ) { + this._trigger( n, event, this.ui() ); + } }, plugins: {}, @@ -897,8 +908,8 @@ $.ui.plugin.add( "resizable", "containment", { co = that.containerOffset; ch = that.containerSize.height; cw = that.containerSize.width; - width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw ); - height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ; + width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw ); + height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch ); that.parentData = { element: ce, @@ -1205,4 +1216,4 @@ $.ui.plugin.add( "resizable", "grid", { return $.ui.resizable; -} ) ); +} ); |