You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if widgets could define handlers for events targeting the titles they own. The use case I have top of mind is converting an editor preview widget to a normal editor widget (#5757), but other use cases could no doubt be found.
In our tabbar implementation, we define some handlers to be called on various DOM events:
// If user closes the tab using mouse wheel, nothing should be pasted to an active editor
e.preventDefault();
}
},
h.div(
{className: 'theia-tab-icon-label'},
this.renderIcon(data,isInSidePanel),
this.renderLabel(data,isInSidePanel),
this.renderBadge(data,isInSidePanel)
),
this.renderCloseIcon(data)
);
}
We could generalize that pattern, and do something like:
if(title.ownerinstanceofWidget&&title.owner.handleTabDblClick){// follow the convention that returning `false` prevents further work on the eventconstterminateHandling=title.owner.handleTabDblClick(e)===false||e.defaultPrevented;if(terminateHandling)return!terminateHandling;}// ... default code to run
The text was updated successfully, but these errors were encountered:
Feature Description:
It would be nice if widgets could define handlers for events targeting the titles they own. The use case I have top of mind is converting an editor preview widget to a normal editor widget (#5757), but other use cases could no doubt be found.
In our tabbar implementation, we define some handlers to be called on various DOM events:
theia/packages/core/src/browser/shell/tab-bars.ts
Lines 133 to 158 in 38f176a
We could generalize that pattern, and do something like:
The text was updated successfully, but these errors were encountered: