-
Notifications
You must be signed in to change notification settings - Fork 3
/
smartdocs_oauth_additions.js
22 lines (22 loc) · 1.03 KB
/
smartdocs_oauth_additions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(function($, Drupal) {
// put function into drupal commands:
Drupal.ajax.prototype.commands.setAccessTokenAndLocation =
function(ajax, response, status) {
// response object as passed in our Ajax callback
oAuthAccessTokenAndLocationListener(response);
};
// On hover of the oauth2 button copy the client credential processing form over from Drupal.settings
Drupal.behaviors.replaceOAuthClientCredentialForm = {
attach: function(){
$('.link_open_oauth2:not(.replaceOAuthClientCredentialForm-processed)')
.addClass('replaceOAuthClientCredentialForm-processed')
.hover(function(){
$modal = $('[data-role="oauth2_modal"] .modal-body');
if(!$modal.hasClass('.replaceOAuthClientCredentialForm-processed')) {
$modal.html(Drupal.settings.apigee_oauth_additions_form);
Drupal.attachBehaviors($modal, Drupal.settings);
}
});
}
};
}(jQuery, Drupal));