Issue #824Opened January 31, 2018by anand-gopinath5 reactions

Is it possible to remove "views" of editor Panel

Question

I wish to remove/hide the below mentioned "view" from the Panel. Is it possible via API or I need to externally hide using css ?

34

editor.Panels.getPanel("views").attributes.buttons.models[2].attributes.visible = false;

Answers (3)

ryandebaJanuary 31, 20182 reactions

@anand-gopinath - this code works for me in a plugin: editor.Panels.removeButton("views", "open-layers");

It doesn't seem to work for me after the editor has fully loaded...I suspect that it needs to get removed before the view is rendered, but I haven't confirmed that.

ryandebaJanuary 31, 20182 reactions

@anand-gopinath In case it's helpful, here's some code that I'm using to reorder those buttons (this also probably needs to run in a plugin):

var panelManager = editor.Panels;

// get the buttons
var styleManagerButton = panelManager.getButton("views", "open-sm");
var layersButton = panelManager.getButton("views", "open-layers");
var blocksButton = panelManager.getButton("views", "open-blocks");

// remove the buttons
panelManager.removeButton("views", "open-sm");
panelManager.removeButton("views", "open-layers");
panelManager.removeButton("views", "open-blocks");

// add the buttons back in a custom order
panelManager.addButton("views", blocksButton);
panelManager.addButton("views", styleManagerButton);
panelManager.addButton("views", layersButton);
artfFebruary 5, 20181 reactions

Thanks Ryan, I'll add a new listener, in the next release, which should fix the issue

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.