Skip to content

Commit

Permalink
Load pictograms directly when loading the application
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed May 11, 2023
1 parent afbd67a commit dcf4904
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
4 changes: 0 additions & 4 deletions client/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -3802,10 +3802,6 @@ function fillMenu_TypoSymbol() {
make_layer_name_input(dv2, 'TypoSymbols_output_name');
make_ok_button(dv2, 'yesTypoSymbols');
dv2.selectAll('.params').attr('disabled', true);
if (!(_app.default_symbols) || _app.default_symbols.length === 0) {
_app.default_symbols = [];
prepare_available_symbols();
}
}

function discard_rendering_empty_val() {
Expand Down
21 changes: 4 additions & 17 deletions client/js/layout_features/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ContextMenu from './../context-menu';
import { check_layer_name } from './../function';
import { create_li_layer_elem, drag_elem_geo } from './../helpers';
import { Mround } from './../helpers_math';
import { prepare_available_symbols, setSphereBottom } from './../interface';
import { setSphereBottom } from './../interface';
import { up_legends, up_legend, down_legend } from './../legend';
import { zoom_without_redraw } from './../map_ctrl';
import { isInterrupted } from './../projections';
Expand Down Expand Up @@ -247,17 +247,8 @@ function handleClickAddPicto() {
}
const msg = alertify.notify(_tr('app_page.notification.instruction_click_map'), 'warning', 0);
document.addEventListener('keydown', esc_cancel);
let map_point,
click_pt,
prep_symbols,
available_symbols = false;

if (!(_app.default_symbols) || _app.default_symbols.length === 0) {
_app.default_symbols = [];
prep_symbols = prepare_available_symbols();
} else {
available_symbols = true;
}
let map_point;
let click_pt;

document.body.style.cursor = 'not-allowed';
map.style('cursor', 'crosshair')
Expand All @@ -273,11 +264,7 @@ function handleClickAddPicto() {
}, 500);
map.style('cursor', '').on('click', null);
document.body.style.cursor = '';
if (!available_symbols) {
prep_symbols.then(display_box_symbol);
} else {
display_box_symbol();
}
display_box_symbol();
});
}

Expand Down
3 changes: 2 additions & 1 deletion client/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import './../css/style.css';
import './../css/discretization.css';
import './../node_modules/alertifyjs/build/css/alertify.min.css';
import './../node_modules/alertifyjs/build/css/themes/semantic.min.css';
import { setUpInterface } from './interface';
import { prepare_available_symbols, setUpInterface } from './interface';
import { xhrequest } from './helpers';
import { Mround } from './helpers_math';
import { makeSvgMap } from './map_ctrl';
Expand Down Expand Up @@ -169,6 +169,7 @@ function loadI18next(lang) {
setUpInterface(params.reload);
localize('.i18n');
bindTooltips();
prepare_available_symbols();
}).catch((e) => {
swal({
title: _tr('app_page.common.error'),
Expand Down

0 comments on commit dcf4904

Please sign in to comment.