Skip to content

Commit 49f4b6e

Browse files
committed
fix: visualizzazione icona plugin solo se disponibili
1 parent 70c9e19 commit 49f4b6e

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

assets/src/js/base/sidebar.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ $(document).ready(function () {
8686
const pluginToggle = $(".control-sidebar-button");
8787
const largeScreen = screen.width > 1280;
8888

89-
// Gestione click sul pulsante per il toggle
90-
pluginToggle.on("click", function () {
89+
// Gestione click sul pulsante per il toggle (solo se il pulsante esiste)
90+
if (pluginToggle.length > 0) {
91+
pluginToggle.on("click", function () {
9192
// Add a subtle animation to the button
9293
$(this).css({
9394
"transform": "scale(0.95)",
@@ -112,9 +113,10 @@ $(document).ready(function () {
112113
}, 300);
113114
});
114115

115-
// Barra plugin laterale disabilitata per schermi piccoli
116-
if (largeScreen && !globals.collapse_plugin_sidebar) {
117-
pluginToggle.click();
116+
// Barra plugin laterale disabilitata per schermi piccoli
117+
if (largeScreen && !globals.collapse_plugin_sidebar) {
118+
pluginToggle.click();
119+
}
118120
}
119121

120122
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {

include/top.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@
555555

556556
$in_editor = string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php');
557557
$in_controller = string_contains($_SERVER['SCRIPT_FILENAME'], 'controller.php');
558-
if (($in_editor || $in_controller) && !$isInstallation) {
558+
if (($in_editor || $in_controller) && !$isInstallation && $has_plugins > 0) {
559559
// Menu laterale per la visualizzazione dei plugin
560560
echo '
561561
<div class="control-sidebar-button" title="'.tr('Plugin').'">

0 commit comments

Comments
 (0)