MCPcopy Create free account
hub / github.com/devforth/painterro / closeActiveTool

Method closeActiveTool

js/main.js:890–906  ·  view source on GitHub ↗
(doNotSelect)

Source from the content-addressed store, hash-verified

888 }
889
890 closeActiveTool(doNotSelect) {
891 if (this.activeTool !== undefined) {
892 if (this.activeTool.close !== undefined) {
893 this.activeTool.close();
894 }
895 this.toolControls.innerHTML = '';
896 const btnEl = this.getBtnEl(this.activeTool);
897 if (btnEl) {
898 btnEl.className =
899 this.getBtnEl(this.activeTool).className.replace(' ptro-color-active-control', '');
900 }
901 this.activeTool = undefined;
902 }
903 if (doNotSelect !== true) {
904 this.setActiveTool(this.defaultTool);
905 }
906 }
907
908 handleToolEvent(eventHandler, event) {
909 if (this.select.imagePlaced || this.select.area.activated) {

Callers 10

constructorMethod · 0.95
doCloseMethod · 0.95
undoStateMethod · 0.80
redoStateMethod · 0.80
placeAtMethod · 0.80
startCloseMethod · 0.80
handleMouseDownMethod · 0.80
applyMethod · 0.80
startCloseMethod · 0.80
startCloseMethod · 0.80

Calls 3

getBtnElMethod · 0.95
setActiveToolMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected