Skip to content

Commit 1de8554

Browse files
committed
Fixed boolean traps.
1 parent 6dd4bf7 commit 1de8554

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

tests/unit/resizable/core.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,28 +246,40 @@ QUnit.test( "nested resizable", function( assert ) {
246246

247247
QUnit.test( "Resizable with scrollbars and box-sizing: border-box", function( assert ) {
248248
assert.expect( 4 );
249-
testResizableWithBoxSizing( assert, true, false );
249+
testResizableWithBoxSizing( assert, {
250+
isBorderBox: true,
251+
applyScaleTransform: false
252+
} );
250253
} );
251254

252255
QUnit.test( "Resizable with scrollbars and box-sizing: content-box", function( assert ) {
253256
assert.expect( 4 );
254-
testResizableWithBoxSizing( assert, false, false );
257+
testResizableWithBoxSizing( assert, {
258+
isBorderBox: false,
259+
applyScaleTransform: false
260+
} );
255261
} );
256262

257263
QUnit.test( "Resizable with scrollbars, a transform and box-sizing: border-box", function( assert ) {
258264
assert.expect( 4 );
259-
testResizableWithBoxSizing( assert, true, true );
265+
testResizableWithBoxSizing( assert, {
266+
isBorderBox: true,
267+
applyScaleTransform: true
268+
} );
260269
} );
261270

262271
QUnit.test( "Resizable with scrollbars, a transform and box-sizing: content-box", function( assert ) {
263272
assert.expect( 4 );
264-
testResizableWithBoxSizing( assert, false, true );
273+
testResizableWithBoxSizing( assert, {
274+
isBorderBox: false,
275+
applyScaleTransform: true
276+
} );
265277
} );
266278

267-
function testResizableWithBoxSizing( assert, isBorderBox, applyScaleTransform ) {
279+
function testResizableWithBoxSizing( assert, options ) {
268280
var widthBefore, heightBefore,
269-
cssBoxSizing = isBorderBox ? "border-box" : "content-box",
270-
cssTrasform = applyScaleTransform ? "scale(1.5)" : "",
281+
cssBoxSizing = options.isBorderBox ? "border-box" : "content-box",
282+
cssTransform = options.applyScaleTransform ? "scale(1.5)" : "",
271283
elementContent = $( "<div>" )
272284
.css( {
273285
width: "200px",
@@ -278,7 +290,7 @@ function testResizableWithBoxSizing( assert, isBorderBox, applyScaleTransform )
278290
margin: "20px"
279291
} )
280292
.appendTo( "#resizable1" ),
281-
element = $( "#resizable1" ).css( { overflow: "auto", transform: cssTrasform } ).resizable(),
293+
element = $( "#resizable1" ).css( { overflow: "auto", transform: cssTransform } ).resizable(),
282294
handle = ".ui-resizable-se";
283295

284296
$( "<style> * { box-sizing: " + cssBoxSizing + "; } </style>" ).appendTo( "#qunit-fixture" );

tests/unit/resizable/options.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,17 +568,21 @@ QUnit.test( "alsoResize with box-sizing: border-box", function( assert ) {
568568

569569
QUnit.test( "alsoResize with scrollbars and box-sizing: border-box", function( assert ) {
570570
assert.expect( 4 );
571-
testAlsoResizeWithBoxSizing( assert, true );
571+
testAlsoResizeWithBoxSizing( assert, {
572+
isBorderBox: true
573+
} );
572574
} );
573575

574576
QUnit.test( "alsoResize with scrollbars and box-sizing: content-box", function( assert ) {
575577
assert.expect( 4 );
576-
testAlsoResizeWithBoxSizing( assert, false );
578+
testAlsoResizeWithBoxSizing( assert, {
579+
isBorderBox: false
580+
} );
577581
} );
578582

579-
function testAlsoResizeWithBoxSizing( assert, isBorderBox ) {
583+
function testAlsoResizeWithBoxSizing( assert, options ) {
580584
var widthBefore, heightBefore,
581-
cssBoxSizing = isBorderBox ? "border-box" : "content-box",
585+
cssBoxSizing = options.isBorderBox ? "border-box" : "content-box",
582586
other = $( "<div>" )
583587
.css( {
584588
width: "150px",

0 commit comments

Comments
 (0)