Skip to content

Commit 3adfafc

Browse files
committed
fix: hide 'Show Chart' reminder message when in chart view mode
The info message was visible by default. Hide it via inline style and toggle visibility via JS only when entering/leaving editor mode.
1 parent 91610bd commit 3adfafc

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

classes/Visualizer/Render/Layout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ public static function _renderTabBasic( $args ) {
790790
data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
791791
data-t-chart="<?php _e( 'Edit Data', 'visualizer' ); ?>"
792792
>
793-
<p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
793+
<p class="viz-group-description viz-info-msg" style="display:none"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
794794
</div>
795795
<?php } else { ?>
796796
<input type="button" id="editor-undo" class="button button-secondary" style="display: none" value="<?php _e( 'Undo Changes', 'visualizer' ); ?>">
@@ -799,7 +799,7 @@ public static function _renderTabBasic( $args ) {
799799
data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
800800
data-t-chart="<?php _e( 'View Editor', 'visualizer' ); ?>"
801801
>
802-
<p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
802+
<p class="viz-group-description viz-info-msg" style="display:none"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
803803
<?php } ?>
804804
</form>
805805
</div>

js/simple-editor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
button.html( button.attr( 'data-t-chart' ) );
3131
button.attr( 'data-current', 'chart' );
3232
$('p.viz-editor-selection').show();
33+
$('p.viz-info-msg').hide();
3334
$('.viz-text-editor').hide();
3435
$('.viz-simple-editor').hide();
3536
$( '#canvas' ).css('z-index', '1').show();
@@ -40,6 +41,7 @@
4041
button.html( button.attr( 'data-t-editor' ) );
4142
button.attr( 'data-current', 'editor' );
4243
$('p.viz-editor-selection').hide();
44+
$('p.viz-info-msg').show();
4345
$('.viz-text-editor').css('z-index', '9999').show();
4446
$('.viz-simple-editor').css('z-index', '9999').show();
4547
$( '#canvas' ).css('z-index', '-100').hide();
@@ -53,6 +55,7 @@
5355
button.html( button.attr( 'data-t-chart' ) );
5456
button.attr( 'data-current', 'chart' );
5557
$('p.viz-editor-selection').show();
58+
$('p.viz-info-msg').hide();
5659
$('.viz-text-editor').hide();
5760
$('.viz-simple-editor').hide();
5861
$( '#canvas' ).css('z-index', '1').show();
@@ -74,6 +77,7 @@
7477
button.html( button.attr( 'data-t-chart' ) );
7578
button.attr( 'data-current', 'chart' );
7679
$('p.viz-editor-selection').show();
80+
$('p.viz-info-msg').hide();
7781
$('.viz-table-editor').hide();
7882
$('.viz-simple-editor').hide();
7983
$( '#canvas' ).css('z-index', '1').show();
@@ -84,6 +88,7 @@
8488
button.html( button.attr( 'data-t-editor' ) );
8589
button.attr( 'data-current', 'editor' );
8690
$('p.viz-editor-selection').hide();
91+
$('p.viz-info-msg').show();
8792
$( '.viz-table-editor' ).css("z-index", "9999").show();
8893
$('.viz-simple-editor').css('z-index', '9999').show();
8994
$('body').trigger('visualizer:db:editor:table:redraw', {});
@@ -98,6 +103,7 @@
98103
button.html( button.attr( 'data-t-chart' ) );
99104
button.attr( 'data-current', 'chart' );
100105
$('p.viz-editor-selection').show();
106+
$('p.viz-info-msg').hide();
101107
$('.viz-table-editor').hide();
102108
$('.viz-simple-editor').hide();
103109
$( '#canvas' ).css('z-index', '1').show();

0 commit comments

Comments
 (0)