-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
...dbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey/passphraseChangeEvent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
//TODO: this snippet, as well as ids in passphrase and private key fields can be removed once https://issues.jenkins.io/browse/JENKINS-65616 is completed | ||
var passphraseElement = document.getElementById('sshCredentials_passphrase'); | ||
var privateKeyElement = document.getElementById('sshCredentials_privateKey'); | ||
const passphraseElements = document.getElementsByClassName('sshCredentials_passphrase'); | ||
|
||
passphraseElement.addEventListener("change", event => { | ||
var newEvent = new Event("change") | ||
privateKeyElement.dispatchEvent(newEvent) | ||
}) | ||
if (passphraseElements.length > 0) { | ||
// Failsafe in case there's more than 1 element we'll only use the first one. Should not happen. | ||
passphraseElements[0].addEventListener("change", event => { | ||
var newEvent = new Event("change") | ||
const privateKeyElements = document.getElementsByClassName('sshCredentials_privateKey'); | ||
if (passphraseElements.length > 0) { | ||
privateKeyElements[0].dispatchEvent(newEvent) | ||
} | ||
}) | ||
} |