From 3dc6ceada657f1b2b90e0b578e9085ad5815fdf5 Mon Sep 17 00:00:00 2001 From: Alexey Zakharenkov <35913079+alexey-zakharenkov@users.noreply.github.com> Date: Thu, 15 Oct 2020 23:23:50 +0300 Subject: [PATCH] Unbind 'Region from point' action from those related to a selected region --- web/app/static/borders.js | 29 +++++++----- web/app/templates/index.html | 86 ++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 55 deletions(-) diff --git a/web/app/static/borders.js b/web/app/static/borders.js index bd0d950..534a29c 100644 --- a/web/app/static/borders.js +++ b/web/app/static/borders.js @@ -68,20 +68,22 @@ function init() { function getServerConfiguration() { $.ajax(getServer('config'), { success: function(res) { - if( res.osm ) - $('#osm_actions').css('display', 'block'); + if( res.osm ) { + $('#unbound_actions').show(); + $('#b_divide').show(); + } if( res.tables && res.tables.length > 0 ) { config.OLD_BORDERS_NAME = res.tables[0]; - $('#old_action').css('display', 'block'); + $('#old_action').show(); $('#josm_old').css('display', 'inline'); } if( res.backup ) { $('#backups').show(); } if( res.readonly ) { - $('#action_buttons').css('display', 'none'); - $('#import_link').css('display', 'none'); - $('#backups').css('display', 'none'); + $('#action_buttons').hide(); + $('#import_link').hide(); + $('#backups').hide(); config.READONLY = true; } if( !res.readonly && IMPORT_ENABLED ) { @@ -268,7 +270,12 @@ function selectLayer(e) { $('#b_disable').text(props['disabled'] ? 'Вернуть' : 'Убрать'); } else selectedId = null; - $('#actions').css('visibility', selectedId == null ? 'hidden' : 'visible'); + + if (selectedId) + $('#selected_border_actions').show(); + else + $('#selected_border_actions').hide(); + $('#rename').hide(); } @@ -894,7 +901,7 @@ function bDivide() { divSelectedId = selectedId; $('#actions').hide(); $('#d_count').hide(); - $('#b_divide').hide(); + $('#b_divide_do').hide(); $('#divide').show(); // pre-fill 'like' and 'where' fields $('#region_to_divide').text(borders[divSelectedId].name + ' (' + @@ -933,7 +940,7 @@ function bDividePreview() { } clearDivideLayers(); $('#d_count').hide(); - $('#b_divide').hide(); + $('#b_divide_do').hide(); var apply_to_similar= $('#apply_to_similar').prop('checked'); var params = { 'id': divSelectedId, @@ -981,9 +988,9 @@ function bDivideDrawPreview(response) { } $('#d_count').text(subregions_count_text).show(); if (show_divide_button) - $('#b_divide').show(); + $('#b_divide_do').show(); else - $('#b_divide').hide(); + $('#b_divide_do').hide(); } function bDivideDo() { diff --git a/web/app/templates/index.html b/web/app/templates/index.html index 2e55ab3..8ce9d4d 100644 --- a/web/app/templates/index.html +++ b/web/app/templates/index.html @@ -15,8 +15,8 @@ #panel { width: 250px; float: right; padding: 1em; font-family: sans-serif; font-size: 80% } #panel button { font-size: 9pt; margin: 4px 0; background-color: #eee; } #map { margin-right: 250px; } - #actions { visibility: hidden; } - #osm_actions { display: none; margin-top: 1em; } + #selected_border_actions, #b_divide { display: none; } + #unbound_actions { display: none; margin-bottom: 1em; } #backups { display: none; } #rename, #potential_parents { display: none; margin-left: 10px; } #wait_start_over { display: none; } @@ -109,49 +109,47 @@ Поиск -
-
- - -
- -
-
- -
-
-
-
-
-
-
-
+
+
+
- -
- Название ▼: - -
-
- - +
+
+ + +
+ +
+
+ +
+
+
+
+ Название ▼: + +
+
+ + +
+ +
+
+ Оценка размера по точкам:
+ Оценка размера по нас+пл:
+ Последняя правка:
+ Количество точек:
+ Площадь: км²
+ + Комментарий:
+
+ + Очистить
- -
-
- Оценка размера по точкам:
- Оценка размера по нас+пл:
- Последняя правка:
- Количество точек:
- Площадь: км²
- - Комментарий:
-
- - Очистить
@@ -214,7 +212,7 @@

- +