mirror of
https://github.com/golang/go
synced 2024-11-18 10:04:43 -07:00
godoc/static: replace innerHTML with textContent
Setting innerHTML is a more heavyweight operation that supports HTML. What's being done here doesn't use HTML, so it's viable to use the more lightweight textContent. Change-Id: I46e9359ffe776001836cc09fea88b04364870db7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/235577 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
parent
af9456bb63
commit
6be401e3f7
@ -51,7 +51,7 @@ function initPlayground(transport) {
|
|||||||
var sk = e.shiftKey || localStorage.getItem('play-shiftKey') === 'true';
|
var sk = e.shiftKey || localStorage.getItem('play-shiftKey') === 'true';
|
||||||
if (running) running.Kill();
|
if (running) running.Kill();
|
||||||
output.style.display = 'block';
|
output.style.display = 'block';
|
||||||
outpre.innerHTML = '';
|
outpre.textContent = '';
|
||||||
run1.style.display = 'none';
|
run1.style.display = 'none';
|
||||||
var options = { Race: sk };
|
var options = { Race: sk };
|
||||||
running = transport.Run(text(code), PlaygroundOutput(outpre), options);
|
running = transport.Run(text(code), PlaygroundOutput(outpre), options);
|
||||||
@ -72,20 +72,20 @@ function initPlayground(transport) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var run1 = document.createElement('button');
|
var run1 = document.createElement('button');
|
||||||
run1.innerHTML = 'Run';
|
run1.textContent = 'Run';
|
||||||
run1.className = 'run';
|
run1.className = 'run';
|
||||||
run1.addEventListener('click', onRun, false);
|
run1.addEventListener('click', onRun, false);
|
||||||
var run2 = document.createElement('button');
|
var run2 = document.createElement('button');
|
||||||
run2.className = 'run';
|
run2.className = 'run';
|
||||||
run2.innerHTML = 'Run';
|
run2.textContent = 'Run';
|
||||||
run2.addEventListener('click', onRun, false);
|
run2.addEventListener('click', onRun, false);
|
||||||
var kill = document.createElement('button');
|
var kill = document.createElement('button');
|
||||||
kill.className = 'kill';
|
kill.className = 'kill';
|
||||||
kill.innerHTML = 'Kill';
|
kill.textContent = 'Kill';
|
||||||
kill.addEventListener('click', onKill, false);
|
kill.addEventListener('click', onKill, false);
|
||||||
var close = document.createElement('button');
|
var close = document.createElement('button');
|
||||||
close.className = 'close';
|
close.className = 'close';
|
||||||
close.innerHTML = 'Close';
|
close.textContent = 'Close';
|
||||||
close.addEventListener('click', onClose, false);
|
close.addEventListener('click', onClose, false);
|
||||||
|
|
||||||
var button = document.createElement('div');
|
var button = document.createElement('div');
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user