Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var registerBpmnJSPlugin = require('camunda-modeler-plugin-helpers').registerBpmnJSPlugin;
var tokenSimulation = require('bpmn-js-token-simulation'),
HideModelerElements = require('./HideModelerElements');
tokenSimulation.__init__.push('hideModelerElements');
tokenSimulation.hideModelerElements = [ 'type', HideModelerElements ];
registerBpmnJSPlugin(tokenSimulation);
var registerBpmnJSPlugin = require('camunda-modeler-plugin-helpers').registerBpmnJSPlugin;
var tokenSimulation = require('bpmn-js-token-simulation'),
HideModelerElements = require('./HideModelerElements');
tokenSimulation.__init__.push('hideModelerElements');
tokenSimulation.hideModelerElements = [ 'type', HideModelerElements ];
registerBpmnJSPlugin(tokenSimulation);
function HideModelerElements(eventBus) {
var css = '.properties.hidden { display: none; } .tabs .tab.hidden { display: none; }',
head = document.head,
style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
head.appendChild(style);
eventBus.on(TOGGLE_MODE_EVENT, function(context) {
var simulationModeActive = context.simulationModeActive;
var propertiesPanel = domQuery('.properties');
var xmlTab = domQuery('[data-tab-id="xml"') || domQuery('.tabs a.tab:not(.active)');
if (simulationModeActive) {
domClasses(propertiesPanel).add('hidden');
domClasses(xmlTab).add('hidden');
} else {
domClasses(propertiesPanel).remove('hidden');
domClasses(xmlTab).remove('hidden');
}
});
}