2021-07-13 18:14:13 +00:00
/ * *
* DO NOT EDIT THIS FILE .
* See the following change record for more information ,
* https : //www.drupal.org/node/2815083
* @ preserve
* * /
2021-12-18 06:12:16 +00:00
( ( $ , once ) => {
const deprecatedMessageSuffix = ` is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256 ` ;
const originalJQOnce = $ . fn . once ;
const originalJQRemoveOnce = $ . fn . removeOnce ;
2021-10-29 10:32:32 +00:00
$ . fn . once = function jQueryOnce ( id ) {
Drupal . deprecationError ( {
2021-12-18 06:12:16 +00:00
message : ` jQuery.once() ${ deprecatedMessageSuffix } `
2021-10-29 10:32:32 +00:00
} ) ;
return originalJQOnce . apply ( this , [ id ] ) ;
} ;
$ . fn . removeOnce = function jQueryRemoveOnce ( id ) {
Drupal . deprecationError ( {
2021-12-18 06:12:16 +00:00
message : ` jQuery.removeOnce() ${ deprecatedMessageSuffix } `
2021-10-29 10:32:32 +00:00
} ) ;
return originalJQRemoveOnce . apply ( this , [ id ] ) ;
} ;
2021-12-18 06:12:16 +00:00
const drupalOnce = once ;
2021-07-13 18:14:13 +00:00
function augmentedOnce ( id , selector , context ) {
2021-10-29 10:32:32 +00:00
originalJQOnce . apply ( $ ( selector , context ) , [ id ] ) ;
2021-07-13 18:14:13 +00:00
return drupalOnce ( id , selector , context ) ;
}
function remove ( id , selector , context ) {
2021-10-29 10:32:32 +00:00
originalJQRemoveOnce . apply ( $ ( selector , context ) , [ id ] ) ;
2021-07-13 18:14:13 +00:00
return drupalOnce . remove ( id , selector , context ) ;
}
window . once = Object . assign ( augmentedOnce , drupalOnce , {
2021-12-18 06:12:16 +00:00
remove
2021-07-13 18:14:13 +00:00
} ) ;
} ) ( jQuery , once ) ;