mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	don't try to activate the pane being currently removed
This commit is contained in:
		| @@ -26,16 +26,16 @@ export default class ButtonWidget extends NoteContextAwareWidget { | |||||||
|         this.$widget = $(TPL); |         this.$widget = $(TPL); | ||||||
|  |  | ||||||
|         if (this.settings.onClick) { |         if (this.settings.onClick) { | ||||||
|             this.$widget.on("click", () => { |             this.$widget.on("click", e => { | ||||||
|                 this.$widget.tooltip("hide"); |                 this.$widget.tooltip("hide"); | ||||||
|  |  | ||||||
|                 this.settings.onClick(this) |                 this.settings.onClick(this, e); | ||||||
|             }); |             }); | ||||||
|         } else { |         } else { | ||||||
|             this.$widget.on("click", () => { |             this.$widget.on("click", () => { | ||||||
|                 this.$widget.tooltip("hide"); |                 this.$widget.tooltip("hide"); | ||||||
|  |  | ||||||
|                 this.triggerCommand(this.settings.command) |                 this.triggerCommand(this.settings.command); | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,6 +13,12 @@ export default class ClosePaneButton extends ButtonWidget { | |||||||
|         this.icon("bx-x") |         this.icon("bx-x") | ||||||
|             .title("Close this pane") |             .title("Close this pane") | ||||||
|             .titlePlacement("bottom") |             .titlePlacement("bottom") | ||||||
|             .onClick(widget => widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() })); |             .onClick((widget, e) => { | ||||||
|  |                 // to avoid split pane container detecting click within the pane which would try to activate this | ||||||
|  |                 // pane (which is being removed) | ||||||
|  |                 e.stopPropagation(); | ||||||
|  |  | ||||||
|  |                 widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() }); | ||||||
|  |             }); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user