2015-08-17 17:00:26 -07:00
/ * *
2018-11-23 12:29:20 +00:00
* DO NOT EDIT THIS FILE .
* See the following change record for more information ,
* https : //www.drupal.org/node/2815083
* @ preserve
* * /
2015-08-17 17:00:26 -07:00
( function ( $ , Drupal , drupalSettings ) {
drupalSettings . dialog = {
autoOpen : true ,
dialogClass : '' ,
2018-11-23 12:29:20 +00:00
2015-08-17 17:00:26 -07:00
buttonClass : 'button' ,
buttonPrimaryClass : 'button--primary' ,
2018-11-23 12:29:20 +00:00
close : function close ( event ) {
2016-02-03 14:56:31 -08:00
Drupal . dialog ( event . target ) . close ( ) ;
2015-08-17 17:00:26 -07:00
Drupal . detachBehaviors ( event . target , null , 'unload' ) ;
}
} ;
Drupal . dialog = function ( element , options ) {
2018-11-23 12:29:20 +00:00
var undef = void 0 ;
2016-02-03 14:56:31 -08:00
var $element = $ ( element ) ;
var dialog = {
open : false ,
2018-11-23 12:29:20 +00:00
returnValue : undef
2016-02-03 14:56:31 -08:00
} ;
2015-08-17 17:00:26 -07:00
function openDialog ( settings ) {
settings = $ . extend ( { } , drupalSettings . dialog , options , settings ) ;
2018-11-23 12:29:20 +00:00
2015-08-17 17:00:26 -07:00
$ ( window ) . trigger ( 'dialog:beforecreate' , [ dialog , $element , settings ] ) ;
$element . dialog ( settings ) ;
dialog . open = true ;
$ ( window ) . trigger ( 'dialog:aftercreate' , [ dialog , $element , settings ] ) ;
}
function closeDialog ( value ) {
$ ( window ) . trigger ( 'dialog:beforeclose' , [ dialog , $element ] ) ;
$element . dialog ( 'close' ) ;
dialog . returnValue = value ;
dialog . open = false ;
$ ( window ) . trigger ( 'dialog:afterclose' , [ dialog , $element ] ) ;
}
2018-11-23 12:29:20 +00:00
dialog . show = function ( ) {
openDialog ( { modal : false } ) ;
} ;
dialog . showModal = function ( ) {
openDialog ( { modal : true } ) ;
} ;
dialog . close = closeDialog ;
2015-08-17 17:00:26 -07:00
return dialog ;
} ;
2018-11-23 12:29:20 +00:00
} ) ( jQuery , Drupal , drupalSettings ) ;