Skip to content

Commit 1e76f9d

Browse files
authored
Hide Title Syntax until loaded (#505)
1 parent a57c715 commit 1e76f9d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

ckanext/querytool/fanstatic/javascript/dist/modules/map-module.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ ckan.module('querytool-map', function($) {
273273
var title_id = this.el.context.parentElement.children[0].id;
274274
if(title_id && dynamicTitle != true){
275275
document.getElementById(title_id).innerHTML = dynamicTitle;
276+
document.getElementById(title_id).style.display = "block";
276277
}
277278

278279
var smallIcon = L.icon({

ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckanext/querytool/fanstatic/javascript/vitals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ $(document).ready(function(){
10551055
optionalFilter: optionalFilter,
10561056
});
10571057
$(this).html(dynamicTitle);
1058+
$(this).css("display","block");
10581059
})
10591060
});
10601061

ckanext/querytool/templates/querytool/public/read.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ <h1>{{ querytools[0].title }}</h1>
204204

205205
<div class="item {{ sizeClass }} chart-{{chart_id}} {% if item.type == 'text_box' %}text-box{% endif %} {% if item.type == 'break_line' %}break_line{% endif %} {% if item.filter_visibility == 'public' %}has-filter{% endif %}" id="{{ secondViz }}">
206206
{% if (item.type != 'table') and (item.type !='map') %}
207-
<h3 id="item-title-{{chart_id}}">{{ item.title }}</h3>
207+
<h3 id="item-title-{{chart_id}}" style="display:none">{{ item.title }}</h3>
208208
{% endif %}
209209
{% if item.type == 'map' %}
210-
<h3 id="item-title-{{chart_id}}">{{ item.map_custom_title_field }}</h3>
210+
<h3 id="item-title-{{chart_id}}" style="display:none">{{ item.map_custom_title_field }}</h3>
211211
{% endif %}
212212

213213

@@ -286,7 +286,7 @@ <h3 id="item-title-{{chart_id}}">{{ item.map_custom_title_field }}</h3>
286286
%}
287287
{% endif %}
288288
{% if item.type == 'text_box' %}
289-
<div class="item-content textbox" data-filters="{{ querytool.public_main_filters }}" data-measure="{{ measure_label }}" id="textbox-{{chart_id}}">
289+
<div class="item-content textbox" style="display:none;" data-filters="{{ querytool.public_main_filters }}" data-measure="{{ measure_label }}" id="textbox-{{chart_id}}">
290290
{{ h.render_markdown(h.get_translated(item, 'description'), True, True) }}
291291
</div>
292292
{% endif %}
@@ -369,7 +369,7 @@ <h3 id="item-title-{{chart_id}}">{{ item.map_custom_title_field }}</h3>
369369
{% set additional_description = h.render_markdown(h.get_translated(item, 'additional_description'), True, True) %}
370370

371371
{% if additional_description != "<p>None</p>" %}
372-
<div class='additional_desc' id='item-desc-{{chart_id}}'>{{ additional_description }}</div>
372+
<div class='additional_desc' id='item-desc-{{chart_id}}' style="display:none;">{{ additional_description }}</div>
373373
{% endif %}
374374
<p class="clearfix"></p>
375375
{% endif %}

0 commit comments

Comments
 (0)