Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Allow to hide controls (button, text) in the demo page #740

Merged
merged 2 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
<link rel="shortcut icon" href="./static/img/favicon.ico">
</head>
<body>
<div id="file-selector" class="hidden">
<input type="file" id="bpmn-file" name="file"/>
<label for="bpmn-file" class="btn"><span>open BPMN file</span></label>
<div id="controls" class="hidden">
<div id="file-selector">
<input type="file" id="bpmn-file" name="file"/>
<label for="bpmn-file" class="btn"><span>open BPMN file</span></label>
</div>
<div class="info-centered"><p>(either drop a file here)</p></div>
</div>
<div class="info-centered"><p>(either drop a file here)</p></div>
<div id="graph"></div>

<!-- load global settings -->
Expand Down
6 changes: 5 additions & 1 deletion src/static/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import { documentReady, handleFileSelect, startBpmnVisualization } from '../../i
function startDemo() {
startBpmnVisualization({ container: 'graph' });
document.getElementById('bpmn-file').addEventListener('change', handleFileSelect, false);
document.getElementById('file-selector').classList.remove('hidden');

const parameters = new URLSearchParams(window.location.search);
if (!(parameters.get('hideControls') === 'true')) {
document.getElementById('controls').classList.remove('hidden');
}
}

documentReady(startDemo);