You are not logged in.
Pages: 1
I have an editor with both a left and a right panel and I wanted to give users an option to hide them if the actual HTML area got to narrow to really use (Slight modification of the code in this post)
// Add a button to toggle the panels.
xinha_config.registerButton({
id : "panels",
tooltip : "Toggle Panels",
image : _editor_url + "plugins/PanelToggle/img/panels.gif",
textMode : false,
action : function(editor) { editor._togglePanels(editor); }
});
xinha_config.toolbar[1].splice(1, 0, "separator");
xinha_config.toolbar[1].splice(1, 0, "panels");
// the button action function code
Xinha.prototype._togglePanels = function(editor) {
if (editor._panelsVisible == true) {
editor.hidePanels(['right']);
editor.hidePanels(['left']);
editor._panelsVisible = false;
} else {
editor.showPanels(['right']);
editor.showPanels(['left']);
editor._panelsVisible = true;
}
};
// initial visibility setting
Xinha.prototype._panelsVisible = true;
This goes in the config file. I created a "PanelToggle" plugin folder that only has the button image in it. You could point it to a button image anywhere you want though.
Offline
Pages: 1