Skip to content

Commit

Permalink
revert fixes and add flag for edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
smellman committed Jul 25, 2024
1 parent e4732ff commit 1fabfc4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/helpers/gtt_map_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,18 @@ def map_tag(map: nil, layers: map&.layers,
if (!#{show}) {
document.addEventListener('contentUpdated', function(){
var target = document.getElementById('#{uid}');
target.classList.add('map-editable');
window.createGttClient(target);
contentObserver();
}, { once: true });
var target = document.getElementById('#{uid}');
if (
document.readyState === 'complete'
&& !target.hasChildNodes()
&& document.getElementsByClassName('map-editable').length === 1
) {
window.createGttClient(target);
}
}
document.addEventListener('DOMContentLoaded', function(){
var target = document.getElementById('#{uid}');
Expand Down

0 comments on commit 1fabfc4

Please sign in to comment.