Skip to content

Commit

Permalink
fix(ui): prevent empty header in expanded dialog
Browse files Browse the repository at this point in the history
There was a potential race condition when a dialog header was constructed before locale resources were loaded. This issue couldn't be reproduced reliably.

Closes #10514
  • Loading branch information
AleksueiR committed Jun 9, 2015
1 parent eb3b3ed commit f630f2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/RAMP/Modules/mapClickHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ define([
*/
init: function (map) {

var modalHeader = '<header class="modal-header"><h2 class="modal-title">{0}</h2></header>'.format(i18n.t('mapClickHandler.getFiPanelTitle'));
var modalHeader;

esriMap = map;
topic.subscribe(EventManager.Map.CLICK, function (evt) {
var visibleLayers = [],
rqPromises = [];

// construct modal header on the first call to prevent potential race condition when locale resources didn't have time to load just yet
if (!modalHeader) {
modalHeader = '<header class="modal-header"><h2 class="modal-title">{0}</h2></header>'.format(i18n.t('mapClickHandler.getFiPanelTitle'));
}

if (!RAMP.config.ui.mapQueryToggle.show) {
return;
}
Expand Down

0 comments on commit f630f2e

Please sign in to comment.