@@ -172,7 +172,7 @@ async function addBookmark (context, target) {
172172 return bookmark
173173}
174174
175- export async function toggleBookmark ( userContext , target , bookmarkbutton ) {
175+ export async function toggleBookmark ( userContext , target , bookmarkButton ) {
176176 await store . fetcher . load ( userContext . bookmarkDocument )
177177 const bookmarks = store . each (
178178 null ,
@@ -186,7 +186,7 @@ export async function toggleBookmark (userContext, target, bookmarkbutton) {
186186 for ( let i = 0 ; i < bookmarks . length ; i ++ ) {
187187 try {
188188 await updatePromise ( store . connectedStatements ( bookmarks [ i ] ) , [ ] )
189- bookmarkbutton . style . backgroundColor = 'white'
189+ bookmarkButton . style . backgroundColor = 'white'
190190 debug . log ( 'Bookmark deleted: ' + bookmarks [ i ] )
191191 } catch ( e ) {
192192 debug . error ( 'Cant delete bookmark:' + e )
@@ -195,36 +195,36 @@ export async function toggleBookmark (userContext, target, bookmarkbutton) {
195195 }
196196 } else {
197197 const bookmark = await addBookmark ( userContext , target )
198- bookmarkbutton . style . backgroundColor = 'yellow'
198+ bookmarkButton . style . backgroundColor = 'yellow'
199199 debug . log ( 'Bookmark added: ' + bookmark )
200200 }
201201}
202202
203203export async function renderBookmarksButton ( userContext , target ) {
204- async function setBookmarkbuttonColor ( bookmarkbutton ) {
204+ async function setBookmarkButtonColor ( bookmarkButton ) {
205205 await store . fetcher . load ( userContext . bookmarkDocument )
206206 const bookmarked = store . any (
207207 null ,
208208 BOOK ( 'recalls' ) ,
209- bookmarkbutton . target ,
209+ bookmarkButton . target ,
210210 userContext . bookmarkDocument
211211 )
212- bookmarkbutton . style = UI . style . buttonStyle
213- if ( bookmarked ) bookmarkbutton . style . backgroundColor = 'yellow'
212+ bookmarkButton . style = UI . style . buttonStyle
213+ if ( bookmarked ) bookmarkButton . style . backgroundColor = 'yellow'
214214 }
215215
216- let bookmarkbutton
216+ let bookmarkButton
217217 if ( userContext . bookmarkDocument ) {
218- bookmarkbutton = UI . widgets . button (
218+ bookmarkButton = UI . widgets . button (
219219 dom ,
220220 UI . icons . iconBase + BOOKMARK_ICON ,
221221 label ( BOOK ( 'Bookmark' ) ) ,
222222 ( ) => {
223- toggleBookmark ( userContext , target , bookmarkbutton )
223+ toggleBookmark ( userContext , target , bookmarkButton )
224224 }
225225 )
226- bookmarkbutton . target = target
227- await setBookmarkbuttonColor ( bookmarkbutton )
228- return bookmarkbutton
226+ bookmarkButton . target = target
227+ await setBookmarkButtonColor ( bookmarkButton )
228+ return bookmarkButton
229229 }
230230}
0 commit comments