ui: заменить оставшиеся боковые панели на центрированные popup.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-11
@@ -122,8 +122,10 @@
|
||||
</div>
|
||||
|
||||
{% if can_edit_rro %}
|
||||
<div id="rro-form-overlay" onclick="rroCloseForm()" style="display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:1000;"></div>
|
||||
<div id="rro-form-panel" style="position:fixed; top:0; right:0; height:100vh; width:28rem; max-width:96vw; background:var(--color-card); box-shadow:-8px 0 24px rgba(0,0,0,0.18); z-index:1001; transform:translateX(100%); transition:transform 250ms ease; overflow-y:auto;">
|
||||
<div id="rro-form-panel" role="dialog" aria-modal="true"
|
||||
style="display:none; position:fixed; inset:0; z-index:80; background:rgba(0,0,0,0.4); align-items:flex-start; justify-content:center; padding:1.5rem 1rem; overflow-y:auto;"
|
||||
onclick="if(event.target===this) rroCloseForm()">
|
||||
<div style="background:var(--color-card); border-radius:0.75rem; border:1px solid var(--color-border); box-shadow:0 20px 60px rgb(0 0 0/0.2); width:100%; max-width:36rem; margin:auto;">
|
||||
<form id="rro-register-form" hx-post="/rro/create/" hx-target="#main-content" hx-indicator="#loader, find .btn-label-loading" hx-disabled-elt="find button[type=submit]">
|
||||
{% csrf_token %}
|
||||
<div style="padding:1rem 1.25rem; border-bottom:1px solid var(--color-border); display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:var(--color-card); z-index:1;">
|
||||
@@ -222,6 +224,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="application/json" id="rro-registers-json">{{ registers_json|safe }}</script>
|
||||
@@ -236,7 +239,6 @@
|
||||
var TITLE_EDIT = '{% filter escapejs %}{% trans "Редактирование РРО / ПРРО" %}{% endfilter %}';
|
||||
|
||||
function panel() { return document.getElementById('rro-form-panel'); }
|
||||
function overlay() { return document.getElementById('rro-form-overlay'); }
|
||||
function formEl() { return document.getElementById('rro-register-form'); }
|
||||
|
||||
window.rroKindToggle = function (kind) {
|
||||
@@ -245,17 +247,15 @@
|
||||
};
|
||||
|
||||
window.rroCloseForm = function () {
|
||||
var p = panel(), o = overlay();
|
||||
if (p) p.style.transform = 'translateX(100%)';
|
||||
if (o) o.style.display = 'none';
|
||||
var p = panel();
|
||||
if (p) p.style.display = 'none';
|
||||
document.body.style.overflow = '';
|
||||
};
|
||||
|
||||
function openPanel() {
|
||||
var p = panel(), o = overlay();
|
||||
if (o) o.style.display = 'block';
|
||||
requestAnimationFrame(function () {
|
||||
if (p) p.style.transform = 'translateX(0)';
|
||||
});
|
||||
var p = panel();
|
||||
if (p) p.style.display = 'flex';
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
function setVal(id, value) {
|
||||
|
||||
Reference in New Issue
Block a user