@@ -35,21 +35,21 @@ export abstract class BaseHoverWidget extends Widget {
3535 protected _onContentsChange ( ) : void {
3636 this . _scrollbar . scanDomNode ( ) ;
3737 }
38+ }
3839
39- protected _renderAction ( parent : HTMLElement , actionOptions : { label : string , iconClass ?: string , run : ( target : HTMLElement ) => void , commandId : string } , keybindingLabel : string | null ) : IDisposable {
40- const actionContainer = dom . append ( parent , $ ( 'div.action-container' ) ) ;
41- const action = dom . append ( actionContainer , $ ( 'a.action' ) ) ;
42- action . setAttribute ( 'href' , '#' ) ;
43- action . setAttribute ( 'role' , 'button' ) ;
44- if ( actionOptions . iconClass ) {
45- dom . append ( action , $ ( `span.icon.${ actionOptions . iconClass } ` ) ) ;
46- }
47- const label = dom . append ( action , $ ( 'span' ) ) ;
48- label . textContent = keybindingLabel ? `${ actionOptions . label } (${ keybindingLabel } )` : actionOptions . label ;
49- return dom . addDisposableListener ( actionContainer , dom . EventType . CLICK , e => {
50- e . stopPropagation ( ) ;
51- e . preventDefault ( ) ;
52- actionOptions . run ( actionContainer ) ;
53- } ) ;
40+ export function renderHoverAction ( parent : HTMLElement , actionOptions : { label : string , iconClass ?: string , run : ( target : HTMLElement ) => void , commandId : string } , keybindingLabel : string | null ) : IDisposable {
41+ const actionContainer = dom . append ( parent , $ ( 'div.action-container' ) ) ;
42+ const action = dom . append ( actionContainer , $ ( 'a.action' ) ) ;
43+ action . setAttribute ( 'href' , '#' ) ;
44+ action . setAttribute ( 'role' , 'button' ) ;
45+ if ( actionOptions . iconClass ) {
46+ dom . append ( action , $ ( `span.icon.${ actionOptions . iconClass } ` ) ) ;
5447 }
48+ const label = dom . append ( action , $ ( 'span' ) ) ;
49+ label . textContent = keybindingLabel ? `${ actionOptions . label } (${ keybindingLabel } )` : actionOptions . label ;
50+ return dom . addDisposableListener ( actionContainer , dom . EventType . CLICK , e => {
51+ e . stopPropagation ( ) ;
52+ e . preventDefault ( ) ;
53+ actionOptions . run ( actionContainer ) ;
54+ } ) ;
5555}
0 commit comments