File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -65,26 +65,28 @@ togglbutton.render(
65
65
'div[role="dialog"]:not(.toggl)' ,
66
66
{ observe : true } ,
67
67
async function ( elem ) {
68
- const projectElem = document . querySelector ( "#memexTitleInput " ) ;
68
+ const projectElem = document . querySelector ( "div[role='navigation'] h1 " ) ;
69
69
70
- const parent = document . querySelector ( "dl" ) ;
71
70
const description = await getPaneDescription ( elem ) ;
71
+ const targetParent = document . querySelector ( "div[data-testid='issue-viewer-metadata-container']" ) ;
72
+ const targetChildSection = targetParent && targetParent . querySelector ( "div[data-testid='sidebar-section']" ) ;
72
73
73
- const div = document . createElement ( "div" ) ;
74
- div . classList = parent . children [ 0 ] . classList . value ;
75
- div . style . paddingLeft = "16px" ;
74
+ if ( targetChildSection === null ) {
75
+ return ;
76
+ }
76
77
77
- let projectName = "" ;
78
- if ( projectElem ) projectName = projectElem . value ;
78
+ const div = document . createElement ( "div" ) ;
79
+ div . className = targetChildSection . className ;
80
+ div . style . paddingLeft = "8px" ;
79
81
80
82
const link = togglbutton . createTimerLink ( {
81
83
className : "github" ,
82
84
description : description ,
83
- projectName : projectName ,
85
+ projectName : projectElem ? projectElem . textContent . trim ( ) : "" ,
84
86
} ) ;
85
87
86
88
div . appendChild ( link ) ;
87
- parent . prepend ( div ) ;
89
+ targetParent . prepend ( div ) ;
88
90
}
89
91
) ;
90
92
You can’t perform that action at this time.
0 commit comments