mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
Prevent scrolling for textarea preview (#8472)
prevent scrolling for preview Prevent that when clicking on preview for a textarea, the page scrolls to the top and the url changed.
This commit is contained in:
1 parent
3059161906
commit
6b00394d85
1 file changed
+4
-2
@@ -45,7 +45,8 @@ Behaviour.specify(
|
||||
hidePreview.style.display = "none";
|
||||
previewDiv.style.display = "none";
|
||||
|
||||
showPreview.onclick = function () {
|
||||
showPreview.onclick = function (event) {
|
||||
event.preventDefault();
|
||||
// Several TEXTAREAs may exist if CodeMirror is enabled. The first one has reference to the CodeMirror object.
|
||||
var textarea = e.parentNode.getElementsByTagName("TEXTAREA")[0];
|
||||
var text = "";
|
||||
@@ -85,7 +86,8 @@ Behaviour.specify(
|
||||
});
|
||||
};
|
||||
|
||||
hidePreview.onclick = function () {
|
||||
hidePreview.onclick = function (event) {
|
||||
event.preventDefault();
|
||||
hidePreview.style.display = "none";
|
||||
previewDiv.style.display = "none";
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user