Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 修改 PropertyPanel.js
- init() {
- // ... other code snippet
- const closeButton = document.createElement('div');
- closeButton.classList.add('property-panel-close-button');
- container.appendChild(closeButton);
- closeButton.addEventListener('click', e => {
- e.preventDefault();
- this.setVisible(false);
- });
- this.closeButton = closeButton;
- // ... other code snippet
- this.setVisible(false);
- }
- // ... other code snippet
- setVisible(isVisible) {
- if (isVisible) {
- this.container.style.display = 'block';
- } else {
- this.container.style.display = 'none';
- }
- }
- isVisible() {
- return this.container.style.display === 'block';
- }
- // 修改 Viewer.js
- onMouseClicked( event ) {
- // ... other code snippets
- if(!this.propertyPanel.isVisible()) {
- this.propertyPanel.setVisible(true);
- }
- }
Add Comment
Please, Sign In to add comment