Hide/show plugin tab

Hello guys,

My plugin has a main tab with terminal to send commands to the arduino but it's related to "advanced users" and more usefull during setup. So I want to put an option on settings tab to hide it, but I can find a clue how to do that. Can you help me?

Got it:

        self.showHideTab = function() {
            if ((self.settingsViewModel.settings.plugins.SafetyPrinter.showTerminal() == true) && (!document.getElementById("tab_plugin_SafetyPrinter_link"))) {
                $("<li id='tab_plugin_SafetyPrinter_link' class='' data-bind='allowBindings: true'><a href='#tab_plugin_SafetyPrinter' data-toggle='tab'>Safety Printer</a></li>").appendTo("#tabs");
            } else if (self.settingsViewModel.settings.plugins.SafetyPrinter.showTerminal() == false) {
                $('#tab_plugin_SafetyPrinter_link').remove();
            }
        }
1 Like