diff --git a/classes/Visualizer/Render/Layout.php b/classes/Visualizer/Render/Layout.php index 3fbb4d2a..8a337f01 100644 --- a/classes/Visualizer/Render/Layout.php +++ b/classes/Visualizer/Render/Layout.php @@ -884,7 +884,7 @@ public static function _renderTabBasic( $args ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison $extra = self::is_hour_selected( $hours, $num ) ? 'selected' : ''; ?> - + - + ); ?> -
  • +
  • -
    -

    - - - + + + + +
    + + +
    @@ -1138,7 +1151,7 @@ class="dashicons dashicons-lock"> foreach ( $schedules as $num => $name ) { $extra = self::is_hour_selected( $hours, $num ) ? 'selected' : ''; ?> - + ); ?> -
  • +
  • -
    -

    - + + + - - + +
    + + +
    diff --git a/css/frame.css b/css/frame.css index 1d36c989..9d72ec36 100644 --- a/css/frame.css +++ b/css/frame.css @@ -1016,6 +1016,48 @@ button#editor-chart-button { text-align: center; } +/* Import steps — stepped data-source + schedule flow */ +.vz-import-step-btn { + width: 100%; + margin-bottom: 4px !important; + text-align: left; +} + +.vz-import-step-toggle { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + margin: 0; + padding: 5px 10px; + background: #f0f0f1; + border: 1px solid #c3c4c7; + border-radius: 2px; + cursor: pointer; + font-size: 13px; + color: #50575e; + line-height: 2; +} + +.vz-import-step-toggle:hover { + background: #e5e5e5; + border-color: #a7aaad; +} + +.vz-import-step-toggle .dashicons { + transition: transform 0.2s ease; + flex-shrink: 0; +} + +.vz-import-step-toggle[aria-expanded="true"] .dashicons { + transform: rotate(180deg); +} + +#vz-wp-sync-options, +#vz-db-sync-options { + padding-top: 8px; +} + #sidebar { border-left: 1px solid #ddd; background: #f3f3f3; diff --git a/js/frame.js b/js/frame.js index 592244d8..4d00a46a 100644 --- a/js/frame.js +++ b/js/frame.js @@ -371,6 +371,8 @@ function init_filter_import() { $( '#db-filter-save-button' ).on( 'click', function(){ $('#vz-filter-wizard').submit(); + $( '#vz-wp-sync-options' ).hide(); + $( '#vz-wp-sync-btn' ).attr( 'aria-expanded', false ); }); } @@ -445,11 +447,27 @@ } } ); + $( document ).on( 'click', '#vz-db-sync-btn', function(){ + var $options = $( '#vz-db-sync-options' ); + var isOpen = $options.is( ':visible' ); + $options.toggle(); + $( this ).attr( 'aria-expanded', ! isOpen ); + } ); + + $( document ).on( 'click', '#vz-wp-sync-btn', function(){ + var $options = $( '#vz-wp-sync-options' ); + var isOpen = $options.is( ':visible' ); + $options.toggle(); + $( this ).attr( 'aria-expanded', ! isOpen ); + } ); + $( '#db-chart-save-button' ).on( 'click', function(){ // submit only if a query has been provided. if($('#db-query-form .visualizer-db-query').val().length > 0){ $('#viz-db-wizard-params').val($('#db-query-form').serialize()); $('#vz-db-wizard').submit(); + $( '#vz-db-sync-options' ).hide(); + $( '#vz-db-sync-btn' ).attr( 'aria-expanded', false ); }else{ $('#canvas').unlock(); }