adding an image-selected feature. uses are wip

pull/8/head
Stephen Searles 7 years ago
parent 050c65679a
commit 5897b6874d
  1. 8
      media.go

@ -245,6 +245,7 @@ func (ch *CaddyHugo) serveMediaPage(w http.ResponseWriter, r *http.Request) (int
<head><style>
iframe { height: 100%; }
.img { display: inline-block; text-align: center; max-width: 19.9vw; min-height: 120px;}
.img.selected { background-color: light-blue; }
.copy { cursor: pointer; }
@media (max-width: 800px) {
.img {
@ -290,6 +291,13 @@ func (ch *CaddyHugo) serveMediaPage(w http.ResponseWriter, r *http.Request) (int
evt.target.previousSibling.select();
document.execCommand("copy");
}
if (evt.target.tagName === "IMG") {
var current = document.querySelector(".img.selected");
if (current) {
current.classList = "img";
}
evt.target.parentElement.classList = "img selected";
}
}
document.querySelector('body').onmouseup = function (evt) {
if (evt.target.tagName === "INPUT" && evt.target.type === "text") {

Loading…
Cancel
Save