File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed
classes/Visualizer/Elementor Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,11 @@ function () {
100100 // D3 render library (AI charts).
101101 $ d3_renderer_asset = VISUALIZER_ABSPATH . '/classes/Visualizer/D3Renderer/build/index.asset.php ' ;
102102 if ( file_exists ( $ d3_renderer_asset ) && ! wp_script_is ( 'visualizer-d3-renderer ' , 'registered ' ) ) {
103+ /**
104+ * Ignore missing build asset in source checkout.
105+ *
106+ * @phpstan-ignore-next-line
107+ */
103108 $ d3_asset = include $ d3_renderer_asset ;
104109 wp_register_script (
105110 'visualizer-d3-renderer ' ,
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ i.mce-i-visualizer-icon:before {
200200
201201button .visualizer-library-chart-insert {
202202 position : absolute;
203- top : 45% ;
204- left : 45% ;
203+ top : 50% ;
204+ left : 50% ;
205+ transform : translate (-50% , -50% );
205206}
Original file line number Diff line number Diff line change 163163 }
164164
165165 self . renderCollection ( ) ;
166- $ ( '.visualizer-library-chart' ) . css ( 'position' , 'relative' )
167- . append ( $ (
168- // jshint ignore:start
169- '<div class="visualizer-chart-bg"></div>'
170- + '<div class="visualizer-chart-insert-bg">'
171- + '<button class="button button-primary visualizer-library-chart-insert">' + visualizer . i10n . insert + '</button>'
172- + '</div>'
173- // jshint ignore:end
174- ) )
175- . on ( 'mouseover' , function ( ) {
176- $ ( this ) . addClass ( 'hover' ) ;
177- } ) ;
166+ if ( self . collection . length > 0 ) {
167+ $ ( '.visualizer-library-chart' ) . css ( 'position' , 'relative' )
168+ . append ( $ (
169+ // jshint ignore:start
170+ '<div class="visualizer-chart-bg"></div>'
171+ + '<div class="visualizer-chart-insert-bg">'
172+ + '<button class="button button-primary visualizer-library-chart-insert">' + visualizer . i10n . insert + '</button>'
173+ + '</div>'
174+ // jshint ignore:end
175+ ) )
176+ . on ( 'mouseover' , function ( ) {
177+ $ ( this ) . addClass ( 'hover' ) ;
178+ } ) ;
179+ }
178180 content . unlock ( ) ;
179181 }
180182 }
You can’t perform that action at this time.
0 commit comments