Skip to content

Commit 7a58250

Browse files
committed
chore: addresed pr review changes
1 parent 064c73b commit 7a58250

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

classes/Visualizer/Render/Library.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ private function getDisplayForm() {
212212
* @access private
213213
*/
214214
private function _renderProPopupBlocker() {
215+
if ( Visualizer_Module::is_pro() ) {
216+
return;
217+
}
215218
$license = get_option( 'visualizer_pro_license_data', 'free' );
216219
$license_key = '';
217220
$download_id = '';
@@ -221,13 +224,11 @@ private function _renderProPopupBlocker() {
221224
}
222225
$admin_license_url = admin_url( 'options-general.php#visualizer_pro_license' );
223226
$renew_license_url = tsdk_utmify( Visualizer_Plugin::STORE_URL . '?edd_license_key=' . $license_key . '&download_id=' . $download_id, 'visualizer_license_block' );
224-
225-
if ( ! Visualizer_Module::is_pro() ) {
226-
echo '
227+
echo '
227228
<div class="vizualizer-renew-notice-overlay" id="overlay-visualizer"></div>
228229
<div class="vizualizer-renew-notice-popup">
229230
<h1 class="vizualizer-renew-notice-heading">Alert!</h1>
230-
<p class="vizualizer-renew-notice-message">' . esc_html__( 'In order to edit premium charts, benefit from updates and support for Visualizer Premium plugin, please renew your license code or activate it.', 'visualizer' ) . ' </p>
231+
<p class="vizualizer-renew-notice-message">' . esc_html__( 'In order to edit premium charts, benefit from updates and support for Visualizer Premium plugin, please renew your license code or activate it.', 'visualizer' ) . '</p>
231232
<div class="vizualizer-renew-notice-buttons-container">
232233
<a href="' . esc_url( $renew_license_url) . '" target="_blank">
233234
<button class="vizualizer-renew-notice-button vizualizer-renew-notice-renew-button">
@@ -239,18 +240,20 @@ private function _renderProPopupBlocker() {
239240
<span class="dashicons dashicons-unlock"></span> ' . esc_html__( 'Activate License', 'visualizer' ) . '
240241
</button>
241242
</a>
243+
<button class="vizualizer-renew-notice-button vizualizer-renew-notice-close-icon" aria-label="Close" onclick="closePopup()">
244+
<i class="dashicons dashicons-no"></i>
245+
</button>
242246
</div>
243-
<i class="dashicons dashicons-no vizualizer-renew-notice-close-icon"></i>
244247
</div>
245248
<script>
246-
jQuery(document).ready(function($) {
247-
$(".vizualizer-renew-notice-close-icon").on("click", function() {
248-
$("#overlay-visualizer").css("display", "none");
249-
$(".vizualizer-renew-notice-popup").css("display", "none");
250-
});
251-
});
249+
function closePopup() {
250+
var overlay = document.getElementById("overlay-visualizer");
251+
var popup = document.querySelector(".vizualizer-renew-notice-popup");
252+
overlay.style.display = "none";
253+
popup.style.display = "none";
254+
}
252255
</script>';
253-
}
256+
254257
}
255258
/**
256259
* Renders library content.

css/library.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,17 @@ div#visualizer-types ul, div#visualizer-types form p {
595595

596596
.vizualizer-renew-notice-close-icon {
597597
position: absolute;
598-
top: 10px;
599-
right: 10px;
598+
top: -10px;
599+
right: -70px;
600600
cursor: pointer;
601601
color: #333;
602+
background: none;
603+
border: none;
604+
padding: 0;
605+
outline: none;
606+
/* Reset button styles */
607+
display: inline-block;
608+
font: inherit;
609+
text-align: inherit;
610+
text-decoration: none;
602611
}

js/library.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ function createPopupProBlocker( $ , e ) {
8585
$(this).parent('form').submit();
8686
});
8787

88-
$('.visualizer-chart-shortcode').click(function (e) {
88+
$('.visualizer-chart-shortcode').click(function (event) {
8989

90-
if ( createPopupProBlocker( $, e ) ) {
91-
e.preventDefault();
92-
e.stopPropagation();
90+
if ( createPopupProBlocker( $, event ) ) {
91+
event.preventDefault();
92+
event.stopPropagation();
9393
return;
9494
}
9595

@@ -98,12 +98,12 @@ function createPopupProBlocker( $ , e ) {
9898
if (window.getSelection && document.createRange) {
9999
selection = window.getSelection();
100100
range = document.createRange();
101-
range.selectNodeContents(e.target);
101+
range.selectNodeContents(event.target);
102102
selection.removeAllRanges();
103103
selection.addRange(range);
104104
} else if (document.selection && document.body.createTextRange) {
105105
range = document.body.createTextRange();
106-
range.moveToElementText(e.target);
106+
range.moveToElementText(event.target);
107107
range.select();
108108
}
109109
});

0 commit comments

Comments
 (0)