Merge pull request #1950 from yoyomo/issue-1949
#1949 update for hidden only on clipboard
This commit is contained in:
commit
59bd5db556
|
@ -4,12 +4,14 @@
|
||||||
window.onunload = function () { };
|
window.onunload = function () { };
|
||||||
|
|
||||||
// Global variable, shared between modules
|
// Global variable, shared between modules
|
||||||
function playground_text(playground) {
|
function playground_text(playground, hidden = true) {
|
||||||
let code_block = playground.querySelector("code");
|
let code_block = playground.querySelector("code");
|
||||||
|
|
||||||
if (window.ace && code_block.classList.contains("editable")) {
|
if (window.ace && code_block.classList.contains("editable")) {
|
||||||
let editor = window.ace.edit(code_block);
|
let editor = window.ace.edit(code_block);
|
||||||
return editor.getValue();
|
return editor.getValue();
|
||||||
|
} else if (hidden) {
|
||||||
|
return code_block.textContent;
|
||||||
} else {
|
} else {
|
||||||
return code_block.innerText;
|
return code_block.innerText;
|
||||||
}
|
}
|
||||||
|
@ -599,7 +601,7 @@ function playground_text(playground) {
|
||||||
text: function (trigger) {
|
text: function (trigger) {
|
||||||
hideTooltip(trigger);
|
hideTooltip(trigger);
|
||||||
let playground = trigger.closest("pre");
|
let playground = trigger.closest("pre");
|
||||||
return playground_text(playground);
|
return playground_text(playground, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue