@@ -86,25 +86,25 @@ $.widget( "ui.dialog", {
86
86
87
87
_create : function ( ) {
88
88
this . originalCss = {
89
- display : this . element [ 0 ] . style . display ,
90
- width : this . element [ 0 ] . style . width ,
91
- minHeight : this . element [ 0 ] . style . minHeight ,
92
- maxHeight : this . element [ 0 ] . style . maxHeight ,
93
- height : this . element [ 0 ] . style . height
89
+ display : this . element [ 0 ] . style . display ,
90
+ width : this . element [ 0 ] . style . width ,
91
+ minHeight : this . element [ 0 ] . style . minHeight ,
92
+ maxHeight : this . element [ 0 ] . style . maxHeight ,
93
+ height : this . element [ 0 ] . style . height
94
94
} ;
95
95
this . originalPosition = {
96
96
parent : this . element . parent ( ) ,
97
97
index : this . element . parent ( ) . children ( ) . index ( this . element )
98
98
} ;
99
- this . originalTitle = this . element . attr ( "title" ) ;
99
+ this . originalTitle = this . element . attr ( "title" ) ;
100
100
this . options . title = this . options . title || this . originalTitle ;
101
101
102
102
this . _createWrapper ( ) ;
103
103
104
104
this . element
105
105
. show ( )
106
- . removeAttr ( "title" )
107
- . addClass ( "ui-dialog-content ui-widget-content" )
106
+ . removeAttr ( "title" )
107
+ . addClass ( "ui-dialog-content ui-widget-content" )
108
108
. appendTo ( this . uiDialog ) ;
109
109
110
110
this . _createTitlebar ( ) ;
@@ -144,7 +144,7 @@ $.widget( "ui.dialog", {
144
144
145
145
this . element
146
146
. removeUniqueId ( )
147
- . removeClass ( "ui-dialog-content ui-widget-content" )
147
+ . removeClass ( "ui-dialog-content ui-widget-content" )
148
148
. css ( this . originalCss )
149
149
// Without detaching first, the following becomes really slow
150
150
. detach ( ) ;
@@ -157,7 +157,7 @@ $.widget( "ui.dialog", {
157
157
158
158
next = originalPosition . parent . children ( ) . eq ( originalPosition . index ) ;
159
159
// Don't try to place the dialog next to itself (#8613)
160
- if ( next . length && next [ 0 ] !== this . element [ 0 ] ) {
160
+ if ( next . length && next [ 0 ] !== this . element [ 0 ] ) {
161
161
next . before ( this . element ) ;
162
162
} else {
163
163
originalPosition . parent . append ( this . element ) ;
@@ -183,7 +183,7 @@ $.widget( "ui.dialog", {
183
183
this . _focusedElement = null ;
184
184
this . _destroyOverlay ( ) ;
185
185
186
- if ( ! this . opener . filter ( ":focusable" ) . focus ( ) . length ) {
186
+ if ( ! this . opener . filter ( ":focusable" ) . focus ( ) . length ) {
187
187
188
188
// support: IE9
189
189
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
@@ -243,18 +243,18 @@ $.widget( "ui.dialog", {
243
243
}
244
244
245
245
this . _isOpen = true ;
246
- this . opener = $ ( this . document [ 0 ] . activeElement ) ;
246
+ this . opener = $ ( this . document [ 0 ] . activeElement ) ;
247
247
248
248
this . _size ( ) ;
249
249
this . _position ( ) ;
250
250
this . _createOverlay ( ) ;
251
251
this . _moveToTop ( null , true ) ;
252
252
this . _show ( this . uiDialog , this . options . show , function ( ) {
253
253
that . _focusTabbable ( ) ;
254
- that . _trigger ( "focus" ) ;
254
+ that . _trigger ( "focus" ) ;
255
255
} ) ;
256
256
257
- this . _trigger ( "open" ) ;
257
+ this . _trigger ( "open" ) ;
258
258
} ,
259
259
260
260
_focusTabbable : function ( ) {
@@ -326,9 +326,9 @@ $.widget( "ui.dialog", {
326
326
if ( event . keyCode !== $ . ui . keyCode . TAB ) {
327
327
return ;
328
328
}
329
- var tabbables = this . uiDialog . find ( ":tabbable" ) ,
330
- first = tabbables . filter ( ":first" ) ,
331
- last = tabbables . filter ( ":last" ) ;
329
+ var tabbables = this . uiDialog . find ( ":tabbable" ) ,
330
+ first = tabbables . filter ( ":first" ) ,
331
+ last = tabbables . filter ( ":last" ) ;
332
332
333
333
if ( ( event . target === last [ 0 ] || event . target === this . uiDialog [ 0 ] ) && ! event . shiftKey ) {
334
334
first . focus ( 1 ) ;
@@ -348,25 +348,25 @@ $.widget( "ui.dialog", {
348
348
// We assume that any existing aria-describedby attribute means
349
349
// that the dialog content is marked up properly
350
350
// otherwise we brute force the content as the description
351
- if ( ! this . element . find ( "[aria-describedby]" ) . length ) {
351
+ if ( ! this . element . find ( "[aria-describedby]" ) . length ) {
352
352
this . uiDialog . attr ( {
353
- "aria-describedby" : this . element . uniqueId ( ) . attr ( "id" )
353
+ "aria-describedby" : this . element . uniqueId ( ) . attr ( "id" )
354
354
} ) ;
355
355
}
356
356
} ,
357
357
358
358
_createTitlebar : function ( ) {
359
359
var uiDialogTitle ;
360
360
361
- this . uiDialogTitlebar = $ ( "<div>" )
362
- . addClass ( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
361
+ this . uiDialogTitlebar = $ ( "<div>" )
362
+ . addClass ( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
363
363
. prependTo ( this . uiDialog ) ;
364
364
this . _on ( this . uiDialogTitlebar , {
365
365
mousedown : function ( event ) {
366
366
// Don't prevent click on close button (#8838)
367
367
// Focusing a dialog that is partially scrolled out of view
368
368
// causes the browser to scroll it into view, preventing the click event
369
- if ( ! $ ( event . target ) . closest ( ".ui-dialog-titlebar-close" ) ) {
369
+ if ( ! $ ( event . target ) . closest ( ".ui-dialog-titlebar-close" ) ) {
370
370
// Dialog isn't getting focus when dragging (#8063)
371
371
this . uiDialog . focus ( ) ;
372
372
}
@@ -384,7 +384,7 @@ $.widget( "ui.dialog", {
384
384
} ,
385
385
text : false
386
386
} )
387
- . addClass ( "ui-dialog-titlebar-close" )
387
+ . addClass ( "ui-dialog-titlebar-close" )
388
388
. appendTo ( this . uiDialogTitlebar ) ;
389
389
this . _on ( this . uiDialogTitlebarClose , {
390
390
click : function ( event ) {
@@ -393,30 +393,30 @@ $.widget( "ui.dialog", {
393
393
}
394
394
} ) ;
395
395
396
- uiDialogTitle = $ ( "<span>" )
396
+ uiDialogTitle = $ ( "<span>" )
397
397
. uniqueId ( )
398
- . addClass ( "ui-dialog-title" )
398
+ . addClass ( "ui-dialog-title" )
399
399
. prependTo ( this . uiDialogTitlebar ) ;
400
400
this . _title ( uiDialogTitle ) ;
401
401
402
402
this . uiDialog . attr ( {
403
- "aria-labelledby" : uiDialogTitle . attr ( "id" )
403
+ "aria-labelledby" : uiDialogTitle . attr ( "id" )
404
404
} ) ;
405
405
} ,
406
406
407
407
_title : function ( title ) {
408
408
if ( ! this . options . title ) {
409
- title . html ( " " ) ;
409
+ title . html ( " " ) ;
410
410
}
411
411
title . text ( this . options . title ) ;
412
412
} ,
413
413
414
414
_createButtonPane : function ( ) {
415
- this . uiDialogButtonPane = $ ( "<div>" )
416
- . addClass ( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ) ;
415
+ this . uiDialogButtonPane = $ ( "<div>" )
416
+ . addClass ( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ) ;
417
417
418
- this . uiButtonSet = $ ( "<div>" )
419
- . addClass ( "ui-dialog-buttonset" )
418
+ this . uiButtonSet = $ ( "<div>" )
419
+ . addClass ( "ui-dialog-buttonset" )
420
420
. appendTo ( this . uiDialogButtonPane ) ;
421
421
422
422
this . _createButtons ( ) ;
@@ -431,7 +431,7 @@ $.widget( "ui.dialog", {
431
431
this . uiButtonSet . empty ( ) ;
432
432
433
433
if ( $ . isEmptyObject ( buttons ) || ( $ . isArray ( buttons ) && ! buttons . length ) ) {
434
- this . uiDialog . removeClass ( "ui-dialog-buttons" ) ;
434
+ this . uiDialog . removeClass ( "ui-dialog-buttons" ) ;
435
435
return ;
436
436
}
437
437
@@ -445,7 +445,7 @@ $.widget( "ui.dialog", {
445
445
// Change the context for the click callback to be the main element
446
446
click = props . click ;
447
447
props . click = function ( ) {
448
- click . apply ( that . element [ 0 ] , arguments ) ;
448
+ click . apply ( that . element [ 0 ] , arguments ) ;
449
449
} ;
450
450
buttonOptions = {
451
451
icons : props . icons ,
@@ -457,7 +457,7 @@ $.widget( "ui.dialog", {
457
457
. button ( buttonOptions )
458
458
. appendTo ( that . uiButtonSet ) ;
459
459
} ) ;
460
- this . uiDialog . addClass ( "ui-dialog-buttons" ) ;
460
+ this . uiDialog . addClass ( "ui-dialog-buttons" ) ;
461
461
this . uiDialogButtonPane . appendTo ( this . uiDialog ) ;
462
462
} ,
463
463
@@ -477,7 +477,7 @@ $.widget( "ui.dialog", {
477
477
handle : ".ui-dialog-titlebar" ,
478
478
containment : "document" ,
479
479
start : function ( event , ui ) {
480
- $ ( this ) . addClass ( "ui-dialog-dragging" ) ;
480
+ $ ( this ) . addClass ( "ui-dialog-dragging" ) ;
481
481
that . _blockFrames ( ) ;
482
482
that . _trigger ( "dragStart" , event , filteredUi ( ui ) ) ;
483
483
} ,
@@ -494,7 +494,7 @@ $.widget( "ui.dialog", {
494
494
"top" + ( top >= 0 ? "+" : "" ) + top ,
495
495
of : that . window
496
496
} ;
497
- $ ( this ) . removeClass ( "ui-dialog-dragging" ) ;
497
+ $ ( this ) . removeClass ( "ui-dialog-dragging" ) ;
498
498
that . _unblockFrames ( ) ;
499
499
that . _trigger ( "dragStop" , event , filteredUi ( ui ) ) ;
500
500
}
@@ -531,7 +531,7 @@ $.widget( "ui.dialog", {
531
531
minHeight : this . _minHeight ( ) ,
532
532
handles : resizeHandles ,
533
533
start : function ( event , ui ) {
534
- $ ( this ) . addClass ( "ui-dialog-resizing" ) ;
534
+ $ ( this ) . addClass ( "ui-dialog-resizing" ) ;
535
535
that . _blockFrames ( ) ;
536
536
that . _trigger ( "resizeStart" , event , filteredUi ( ui ) ) ;
537
537
} ,
@@ -551,7 +551,7 @@ $.widget( "ui.dialog", {
551
551
"top" + ( top >= 0 ? "+" : "" ) + top ,
552
552
of : that . window
553
553
} ;
554
- $ ( this ) . removeClass ( "ui-dialog-resizing" ) ;
554
+ $ ( this ) . removeClass ( "ui-dialog-resizing" ) ;
555
555
that . _unblockFrames ( ) ;
556
556
that . _trigger ( "resizeStop" , event , filteredUi ( ui ) ) ;
557
557
}
@@ -577,7 +577,7 @@ $.widget( "ui.dialog", {
577
577
578
578
_position : function ( ) {
579
579
// Need to show the dialog to get the actual offset in the position plugin
580
- var isVisible = this . uiDialog . is ( ":visible" ) ;
580
+ var isVisible = this . uiDialog . is ( ":visible" ) ;
581
581
if ( ! isVisible ) {
582
582
this . uiDialog . show ( ) ;
583
583
}
@@ -607,7 +607,7 @@ $.widget( "ui.dialog", {
607
607
this . _size ( ) ;
608
608
this . _position ( ) ;
609
609
}
610
- if ( this . uiDialog . is ( ":data(ui-resizable)" ) ) {
610
+ if ( this . uiDialog . is ( ":data(ui-resizable)" ) ) {
611
611
this . uiDialog . resizable ( "option" , resizableOptions ) ;
612
612
}
613
613
} ,
@@ -644,9 +644,9 @@ $.widget( "ui.dialog", {
644
644
}
645
645
646
646
if ( key === "draggable" ) {
647
- isDraggable = uiDialog . is ( ":data(ui-draggable)" ) ;
647
+ isDraggable = uiDialog . is ( ":data(ui-draggable)" ) ;
648
648
if ( isDraggable && ! value ) {
649
- uiDialog . draggable ( "destroy" ) ;
649
+ uiDialog . draggable ( "destroy" ) ;
650
650
}
651
651
652
652
if ( ! isDraggable && value ) {
@@ -660,9 +660,9 @@ $.widget( "ui.dialog", {
660
660
661
661
if ( key === "resizable" ) {
662
662
// currently resizable, becoming non-resizable
663
- isResizable = uiDialog . is ( ":data(ui-resizable)" ) ;
663
+ isResizable = uiDialog . is ( ":data(ui-resizable)" ) ;
664
664
if ( isResizable && ! value ) {
665
- uiDialog . resizable ( "destroy" ) ;
665
+ uiDialog . resizable ( "destroy" ) ;
666
666
}
667
667
668
668
// currently resizable, changing handles
@@ -677,7 +677,7 @@ $.widget( "ui.dialog", {
677
677
}
678
678
679
679
if ( key === "title" ) {
680
- this . _title ( this . uiDialogTitlebar . find ( ".ui-dialog-title" ) ) ;
680
+ this . _title ( this . uiDialogTitlebar . find ( ".ui-dialog-title" ) ) ;
681
681
}
682
682
} ,
683
683
@@ -721,7 +721,7 @@ $.widget( "ui.dialog", {
721
721
this . element . height ( Math . max ( 0 , options . height - nonContentHeight ) ) ;
722
722
}
723
723
724
- if ( this . uiDialog . is ( ":data(ui-resizable)" ) ) {
724
+ if ( this . uiDialog . is ( ":data(ui-resizable)" ) ) {
725
725
this . uiDialog . resizable ( "option" , "minHeight" , this . _minHeight ( ) ) ;
726
726
}
727
727
} ,
@@ -749,13 +749,13 @@ $.widget( "ui.dialog", {
749
749
} ,
750
750
751
751
_allowInteraction : function ( event ) {
752
- if ( $ ( event . target ) . closest ( ".ui-dialog" ) . length ) {
752
+ if ( $ ( event . target ) . closest ( ".ui-dialog" ) . length ) {
753
753
return true ;
754
754
}
755
755
756
756
// TODO: Remove hack when datepicker implements
757
757
// the .ui-front logic (#8989)
758
- return ! ! $ ( event . target ) . closest ( ".ui-datepicker" ) . length ;
758
+ return ! ! $ ( event . target ) . closest ( ".ui-datepicker" ) . length ;
759
759
} ,
760
760
761
761
_createOverlay : function ( ) {
@@ -790,8 +790,8 @@ $.widget( "ui.dialog", {
790
790
} ) ;
791
791
}
792
792
793
- this . overlay = $ ( "<div>" )
794
- . addClass ( "ui-widget-overlay ui-front" )
793
+ this . overlay = $ ( "<div>" )
794
+ . addClass ( "ui-widget-overlay ui-front" )
795
795
. appendTo ( this . _appendTo ( ) ) ;
796
796
this . _on ( this . overlay , {
797
797
mousedown : "_keepFocus"
@@ -822,4 +822,4 @@ $.widget( "ui.dialog", {
822
822
}
823
823
} ) ;
824
824
825
- } ( jQuery ) ) ;
825
+ } ( jQuery ) ) ;
0 commit comments