use a self-explanatory "..." in #write-for-frames

This commit is contained in:
tophf 2022-09-17 21:19:18 +03:00
parent 540e2af62c
commit fff59ee12f
3 changed files with 19 additions and 30 deletions

View File

@ -98,6 +98,10 @@
</div> </div>
</template> </template>
<template data-id="writeForFrames">
<div id="write-for-frames" title="&lsaquo;iframe&rsaquo;..." tabindex="0">...</div>
</template>
<script src="js/polyfill.js"></script> <script src="js/polyfill.js"></script>
<script src="js/msg.js"></script> <script src="js/msg.js"></script>
<script src="js/toolbox.js"></script> <script src="js/toolbox.js"></script>
@ -143,7 +147,6 @@
<svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg> <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
<div>U</div> <div>U</div>
</label> </label>
<a id="write-for-frames" title="&lsaquo;iframe&rsaquo;..." tabindex="0" hidden></a>
<span id="write-style-for" i18n="writeStyleFor"></span> <span id="write-style-for" i18n="writeStyleFor"></span>
</div> </div>
</div> </div>

View File

@ -510,33 +510,14 @@ a:hover .svg-icon {
display: none; display: none;
} }
#write-for-frames:not([hidden]) { #write-for-frames {
position: relative; cursor: pointer;
width: 5px; margin: 0 0 -.25em;
height: 5px; font-family: monospace;
display: inline-block;
margin: 0 2px 2px;
--dash: transparent 2px, currentColor 2px, currentColor 3px, transparent 3px;
background: linear-gradient(var(--dash)), linear-gradient(90deg, var(--dash));
} }
#write-for-frames.expanded { #write-style:not(.expanded) .match:not([data-frame-id="0"]),
background: linear-gradient(var(--dash)); #write-style:not(.expanded) .match .match {
}
#write-for-frames::after {
position: absolute;
margin: -2px;
border: 1px solid currentColor;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#write-for-frames:not(.expanded) ~ .match:not([data-frame-id="0"]),
#write-for-frames:not(.expanded) ~ .match .match {
display: none; display: none;
} }

View File

@ -144,10 +144,15 @@ async function initPopup(frames) {
} }
frames.forEach(createWriterElement); frames.forEach(createWriterElement);
Object.assign($('#write-for-frames'), {
onclick: e => e.currentTarget.classList.toggle('expanded'), if (frames.length > 1 && $('.match .match:not(.dupe)')) {
hidden: frames.length < 2 || !$('.match .match:not(.dupe)'), $('#write-style').append(Object.assign(t.template.writeForFrames, {
}); onclick() {
this.remove();
$('#write-style').classList.add('expanded');
},
}));
}
const isStore = tabURL.startsWith(URLS.browserWebStore); const isStore = tabURL.startsWith(URLS.browserWebStore);
if (isStore && !FIREFOX) { if (isStore && !FIREFOX) {