Browse Source
[matrix] Modal cleanup
* General modal cleanup
* Remove second scrollbar caused by modal
pull/4149/head
Josh
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
40 additions and
29 deletions
-
docs/_static/custom.js
-
docs/_static/style.css
-
docs/_templates/layout.html
|
|
@ -9,7 +9,7 @@ let sidebar; |
|
|
|
|
|
|
|
function closeModal(modal) { |
|
|
|
activeModal = null; |
|
|
|
modal.style.display = 'none'; |
|
|
|
modal.hidden = true; |
|
|
|
} |
|
|
|
|
|
|
|
function openModal(modal) { |
|
|
@ -18,7 +18,7 @@ function openModal(modal) { |
|
|
|
} |
|
|
|
|
|
|
|
activeModal = modal; |
|
|
|
modal.style.removeProperty('display'); |
|
|
|
modal.hidden = false; |
|
|
|
} |
|
|
|
|
|
|
|
function updateSetting(element) { |
|
|
@ -30,7 +30,11 @@ function updateSetting(element) { |
|
|
|
|
|
|
|
function getRootAttributeToggle(attributeName, valueName) { |
|
|
|
function toggleRootAttribute(set) { |
|
|
|
document.documentElement.setAttribute(`data-${attributeName}`, set ? valueName : null); |
|
|
|
if (set) { |
|
|
|
document.documentElement.setAttribute(`data-${attributeName}`, valueName); |
|
|
|
} else { |
|
|
|
document.documentElement.removeAttribute(`data-${attributeName}`); |
|
|
|
} |
|
|
|
} |
|
|
|
return toggleRootAttribute; |
|
|
|
} |
|
|
|
|
|
@ -303,7 +303,7 @@ div.modal { |
|
|
|
top: 0; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
overflow: auto; |
|
|
|
overflow: hidden; |
|
|
|
background-color: rgba(0,0,0,0.4); |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
@ -334,6 +334,10 @@ div.modal-content > span.close:focus { |
|
|
|
color: #444; |
|
|
|
} |
|
|
|
|
|
|
|
div.modal input { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
/* copy button */ |
|
|
|
|
|
|
|
.relative-copy { |
|
|
|
|
|
@ -77,31 +77,6 @@ |
|
|
|
</aside> |
|
|
|
{#- The actual body of the contents #} |
|
|
|
<main class="grid-item"> |
|
|
|
<div id="settings" class="modal" style="display: none;" onclick="if (event.target == this){ closeModal(settingsModal); }"> |
|
|
|
<div class="modal-content"> |
|
|
|
<span class="close" onclick="closeModal(settingsModal);" title="Close">×</span> |
|
|
|
<h1>Settings</h1> |
|
|
|
|
|
|
|
<div class='setting'> |
|
|
|
<h3>Use a sans-serif font: |
|
|
|
<label class="toggle" title="Use a sans serif font? Your system font will be used, falling back to `sans-serif`."> |
|
|
|
<input type="checkbox" name="useSansFont" onclick="updateSetting(this);"> |
|
|
|
<span class="toggle-slider"></span> |
|
|
|
</label> |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class='setting'> |
|
|
|
<h3>Enable dark theme: |
|
|
|
<label class="toggle" title="Enable the dark theme."> |
|
|
|
<input type="checkbox" name="useDarkTheme" onclick="updateSetting(this);"> |
|
|
|
<span class="toggle-slider"></span> |
|
|
|
</label> |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% block body %} {% endblock %} |
|
|
|
</main> |
|
|
|
{%- block footer %} |
|
|
@ -132,5 +107,33 @@ |
|
|
|
} |
|
|
|
</script> |
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
<div id="settings" class="modal" onclick="if (event.target == this){ closeModal(settingsModal); }" hidden> |
|
|
|
<div class="modal-content"> |
|
|
|
<span class="close" onclick="closeModal(settingsModal);" title="Close">×</span> |
|
|
|
<h1>Settings</h1> |
|
|
|
|
|
|
|
<div class='setting'> |
|
|
|
<h3>Use a sans-serif font: |
|
|
|
<label class="toggle" |
|
|
|
title="Use a sans serif font? Your system font will be used, falling back to `sans-serif`."> |
|
|
|
<input type="checkbox" name="useSansFont" onclick="updateSetting(this);"> |
|
|
|
<span class="toggle-slider"></span> |
|
|
|
</label> |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class='setting'> |
|
|
|
<h3>Enable dark theme: |
|
|
|
<label class="toggle" title="Enable the dark theme."> |
|
|
|
<input type="checkbox" name="useDarkTheme" onclick="updateSetting(this);"> |
|
|
|
<span class="toggle-slider"></span> |
|
|
|
</label> |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</body> |
|
|
|
</html> |
|
|
|