I want to delete the element that called '.djs-context-pad'

Hello, I want to delete the edit icon after clicking on the element. What should I do? Do you have any relevant documents or topics to share with me? Thank you very much.

What about .djs-context-pad { display: none; }?

Yes,This can be done, but does the library provide a way to solve this problem? For example, a function.

I need your help badly. Thank you very much.

Overriding the module with an empty module using the same name does the trick:

var bpmnModeler = new BpmnJS({
  additionalModules: [
    {
      contextPad: [ 'value', null ],
      contextPadProvider: [ 'value', null ]
    }
  ]
});
2 Likes

I succeeded. Thank you for your help.

Hello, now I have another question. I want to delete the element called’.djs-palette’. What should I do?

You can override the palette in the same way. What are you trying to achieve in general? It sounds like your trying to disallow modeling. There is a dedicated viewer for that.

Yes, now I want to change some node colors, including shape and Connection. I can only find the setColor method in modeler. The viewer doesn’t seem to meet my needs. So I need to get rid of the unnecessary functions. Do you have any good suggestions? Thank you very much.

According to your suggestion, I have achieved what I want to do. But as mentioned above, I don’t think this is the best solution. Is it possible for viewers to do this?

First of all please keep a topic focused on one single question. Open new topics for other questions.

You’re right, the setColor method which is part of Modeling is only available in the modeler. You can still use the low-level methods that are used by setColor to set colors in the viewer. See https://github.com/bpmn-io/bpmn-js-token-simulation/blob/master/lib/features/preserve-element-colors/PreserveElementColors.js#L52.

Thank you very much. I’ll try something next.