Skip to content

Commit 88d421b

Browse files
committed
Dialog: Fix yoda-if, remove unnecessary TODOs; add missing callbacks to commons test
1 parent ad56052 commit 88d421b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/unit/dialog/dialog_common.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ TestHelpers.commonWidgetTests( "dialog", {
2727
width: 300,
2828

2929
// callbacks
30-
create: null
30+
beforeClose: null,
31+
close: null,
32+
create: null,
33+
drag: null,
34+
dragStart: null,
35+
dragStop: null,
36+
focus: null,
37+
open: null,
38+
resize: null,
39+
resizeStart: null,
40+
resizeStop: null
3141
}
3242
});

ui/jquery.ui.dialog.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ $.widget("ui.dialog", {
9494
parent: this.element.parent(),
9595
index: this.element.parent().children().index( this.element )
9696
};
97-
// TODO don't overwrite options
9897
this.options.title = this.options.title || this.originalTitle;
9998
var that = this,
10099
options = this.options,
@@ -276,8 +275,7 @@ $.widget("ui.dialog", {
276275
return;
277276
}
278277

279-
// TODO fix yoda-if
280-
if ( false === this._trigger( "beforeClose", event ) ) {
278+
if ( this._trigger( "beforeClose", event ) === false ) {
281279
return;
282280
}
283281

@@ -294,7 +292,6 @@ $.widget("ui.dialog", {
294292
$( this.document[ 0 ].activeElement ).blur();
295293
}
296294

297-
// TODO shouldn't _hide restore `this` to the instance? would also help tooltip
298295
this._hide( this.uiDialog, this.options.hide, function() {
299296
that._trigger( "close", event );
300297
});

0 commit comments

Comments
 (0)