From 3d46eeeb33bf128c81288e6a345e9242f3ad6b7a Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 1 Nov 2017 12:32:14 +0100 Subject: material: disable editing of entry url input when submitting new url Fixes #1871 Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/nav.scss | 5 +++++ app/Resources/static/themes/material/index.js | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/nav.scss b/app/Resources/static/themes/material/css/nav.scss index 1a25a5be..7898f662 100644 --- a/app/Resources/static/themes/material/css/nav.scss +++ b/app/Resources/static/themes/material/css/nav.scss @@ -95,6 +95,11 @@ nav { display: flex; flex: 1; } + + &.nav-panel-add form.disabled, + &.nav-panel-add form.disabled input { + background-color: whitesmoke; + } } #button_filters { diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index d6afbb8a..36505d71 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -50,6 +50,11 @@ $(document).ready(() => { $('#entry_url').focus(); return false; }); + const materialAddForm = $('.nav-panel-add form[name=entry]'); + materialAddForm.on('submit', () => { + materialAddForm.addClass('disabled'); + $('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur'); + }); $('#nav-btn-search').on('click', () => { $('.nav-panel-buttom').hide(100); $('.nav-panel-search').show(100); -- cgit v1.2.3