Skip to content

Commit 33968b5

Browse files
authored
The core/jquery.once asset library is deprecated (#797)
1 parent 0a55337 commit 33968b5

8 files changed

+21
-20
lines changed

apigee_edge.libraries.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apigee_edge.admin:
77
js/apigee_edge.admin.js: {}
88

99
apigee_edge.analytics:
10-
version: 1.0
10+
version: 1.1
1111
css:
1212
theme:
1313
css/apigee_edge.analytics.css: {}
@@ -27,7 +27,7 @@ apigee_edge.analytics:
2727
- apigee_edge/charts
2828
- core/drupal
2929
- core/jquery
30-
- core/jquery.once
30+
- core/once
3131
- core/drupalSettings
3232

3333
apigee_edge.components:
@@ -51,7 +51,7 @@ apigee_edge.status_property:
5151
css/apigee_edge.status_property.css: {}
5252

5353
apigee_edge.secret:
54-
version: 1.1
54+
version: 1.2
5555
css:
5656
theme:
5757
css/apigee_edge.secret.css: {}
@@ -61,6 +61,7 @@ apigee_edge.secret:
6161
- core/jquery
6262
- core/drupalSettings
6363
- core/drupal
64+
- core/once
6465

6566
apigee_edge.app_view:
6667
version: 1.0
@@ -69,7 +70,7 @@ apigee_edge.app_view:
6970
css/apigee_edge.app_view.css: {}
7071
dependencies:
7172
- core/jquery
72-
- core/jquery.once
73+
- core/once
7374
- core/drupal
7475
- core/drupalSettings
7576

@@ -80,12 +81,12 @@ apigee_edge.app_credential:
8081
css/apigee_edge.app_credential.css: {}
8182

8283
apiproduct_access_admin:
83-
version: 1.0
84+
version: 1.1
8485
js:
8586
js/apigee_edge.apiproduct_access_admin.js: {}
8687
dependencies:
8788
- core/jquery
88-
- core/jquery.once
89+
- core/once
8990
- core/drupal
9091
- core/drupalSettings
9192

js/apigee_edge.analytics.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* @see {@link https://developers.google.com/chart|Google Charts}
3737
*/
3838
Drupal.behaviors.apigeeEdgeAnalyticsDraw = {
39-
attach: function attach(context, drupalSettings) {
40-
$(context).find('body').once('load_google_chart').each(function () {
39+
attach: function attach(context, drupalSettings) {
40+
$(once('load_google_chart', 'body', context)).each(function () {
4141
var metric = drupalSettings.analytics.metric;
4242
var timestamps = drupalSettings.analytics.timestamps;
4343
var values = drupalSettings.analytics.values;
@@ -129,7 +129,7 @@
129129
*/
130130
Drupal.behaviors.apigeeEdgeAnalyticsQuickDatePicker = {
131131
attach: function attach(context, drupalSettings) {
132-
$('#edit-quick-date-picker', context).once().bind('change', function () {
132+
$(once('apigee_analytics_datepicker', '#edit-quick-date-picker', context)).bind('change', function () {
133133
var since = getServerOffsetDate(new Date());
134134
switch (this.selectedOptions['0'].value) {
135135
case '1d':

js/apigee_edge.apiproduct_access_admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Drupal.behaviors.apigee_edge_apiproduct_access_admin = {
3030
attach: function attach(context) {
3131
var self = this;
32-
$('table#visibility').once('visibility').each(function () {
32+
$(once('visibility', 'table#visibility')).each(function () {
3333
var $table = $(this);
3434
var $ancestor = void 0;
3535
var method = void 0;

js/apigee_edge.secret.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$this.addClass(hClass);
4040

4141
// Toggle secret.
42-
$(this).find('.secret__toggle').once().on('click', function (event) {
42+
$(once('apigee_edge_secret', '.secret__toggle', this)).on('click', function (event) {
4343
let index = $(this).closest(appElWrapper).find('.secret__toggle').index(this);
4444
let wrapperIndex = $wrapper.data('app-container-index');
4545
event.preventDefault();
@@ -57,7 +57,7 @@
5757

5858
// Copy to clipboard.
5959
let $copy = $(this).find('.secret__copy');
60-
$copy.find('button').once().on('click', function (event) {
60+
$(once('copybutton', 'button', this)).on('click', function (event) {
6161
let index = $(this).closest(appElWrapper).find('.secret__copy button').index(this);
6262
let wrapperIndex = $wrapper.closest('fieldset').parent().find('fieldset').index($(this).closest('fieldset'));
6363
callEndpoint($wrapper.data('app-keys-url'), function(data) {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
admin:
2-
version: 1.0
2+
version: 1.1
33
css:
44
theme:
55
css/apigee_edge_apiproduct_rbac.admin.css: {}
66
js:
77
js/apigee_edge_apiproduct_rbac.admin.js: {}
88
dependencies:
99
- core/jquery
10-
- core/jquery.once
10+
- core/once
1111
- core/drupal
1212
- core/drupalSettings

modules/apigee_edge_apiproduct_rbac/js/apigee_edge_apiproduct_rbac.admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Drupal.behaviors.apigee_edge_apiproduct_rbac_admin = {
3030
attach: function attach(context) {
3131
var self = this;
32-
$('table#rbac-settings').once('rbac-settings').each(function () {
32+
$(once('rbac-settings', 'table#rbac-settings')).each(function () {
3333
var $table = $(this);
3434
var $ancestor = void 0;
3535
var method = void 0;
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
permissions:
2-
version: VERSION
2+
version: 1.0
33
css:
44
theme:
55
css/apigee_edge_teams.team_permissions.css: {}
66
js:
77
js/apigee_edge_teams.team_permissions.js: {}
88
dependencies:
99
- core/jquery
10-
- core/jquery.once
10+
- core/once
1111
- core/drupal
1212
- core/drupalSettings
1313

1414
switcher:
15-
version: VERSION
15+
version: 1.0
1616
css:
1717
theme:
1818
css/apigee_edge_teams.switcher.css: {}
1919

2020
disabled_action:
21-
version: VERSION
21+
version: 1.0
2222
css:
2323
theme:
2424
css/apigee_edge_teams.disabled_action.css: {}

modules/apigee_edge_teams/js/apigee_edge_teams.team_permissions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Drupal.behaviors.apigee_edge_teams_team_permissions = {
2727
attach: function attach(context) {
2828
var self = this;
29-
$('table#permissions').once('permissions').each(function () {
29+
$(once('permissions', 'table#permissions')).each(function () {
3030
var $table = $(this);
3131
var $ancestor = void 0;
3232
var method = void 0;

0 commit comments

Comments
 (0)