Skip to content

Commit 62d7504

Browse files
committed
issue 4 : some speed improvements
1 parent 8149968 commit 62d7504

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

js/plugin.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var item = document.getElementById('jsDisabled');
2-
if (item.style.display === "block" || !item.style.display) {
3-
item.style.display = 'none';
4-
}
1+
/*
2+
* Plugin JS
3+
* */

wp-js-detect.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function __construct() {
8484
*
8585
*/
8686
public function add_plugin_js() {
87-
wp_enqueue_script('wp-js-detect-js', plugins_url('js/plugin.js', __FILE__));
87+
//wp_enqueue_script('wp-js-detect-js', plugins_url('js/plugin.js', __FILE__));
8888
}
8989

9090
/**
@@ -304,7 +304,15 @@ class="button button-primary button-large">
304304
*
305305
*/
306306
public function wp_non_js_notification() {
307-
echo '<div id="jsDisabled"><p>' . get_option('wp_non_js_notification_text') . '</p></div>';
307+
?>
308+
<div id="jsDisabled"><p><?php echo get_option('wp_non_js_notification_text'); ?></p></div>
309+
<script>
310+
var item = document.getElementById('jsDisabled');
311+
if (item.style.display === "block" || !item.style.display) {
312+
item.style.display = 'none';
313+
}
314+
</script>
315+
<?php
308316

309317
}
310318

0 commit comments

Comments
 (0)