File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed
assets/javascripts/views/content Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -96,16 +96,9 @@ app.views.EntryPage = class EntryPage extends app.View {
9696 return content ;
9797 }
9898
99- const links = ( ( ) => {
100- const result = [ ] ;
101- for ( var link in this . entry . doc . links ) {
102- var url = this . entry . doc . links [ link ] ;
103- result . push (
104- `<a href="${ url } " class="_links-link">${ EntryPage . LINKS [ link ] } </a>` ,
105- ) ;
106- }
107- return result ;
108- } ) ( ) ;
99+ const links = Object . entries ( this . entry . doc . links ) . map ( ( [ link , url ] ) => {
100+ return `<a href="${ url } " class="_links-link">${ EntryPage . LINKS [ link ] } </a>` ;
101+ } ) ;
109102
110103 return `<p class="_links">${ links . join ( "" ) } </p>${ content } ` ;
111104 }
@@ -203,8 +196,8 @@ app.views.EntryPage = class EntryPage extends app.View {
203196 }
204197
205198 restore ( ) {
206- let path ;
207- if ( this . cacheMap [ ( path = this . entry . filePath ( ) ) ] ) {
199+ const path = this . entry . filePath ( ) ;
200+ if ( this . cacheMap [ [ path ] ] ) {
208201 this . render ( this . cacheMap [ path ] , true ) ;
209202 return true ;
210203 }
@@ -226,17 +219,17 @@ app.views.EntryPage = class EntryPage extends app.View {
226219 }
227220
228221 onAltC ( ) {
229- let link ;
230- if ( ! ( link = this . find ( "._attribution:last-child ._attribution-link" ) ) ) {
222+ const link = this . find ( "._attribution:last-child ._attribution-link" ) ;
223+ if ( ! link ) {
231224 return ;
232225 }
233226 console . log ( link . href + location . hash ) ;
234227 navigator . clipboard . writeText ( link . href + location . hash ) ;
235228 }
236229
237230 onAltO ( ) {
238- let link ;
239- if ( ! ( link = this . find ( "._attribution:last-child ._attribution-link" ) ) ) {
231+ const link = this . find ( "._attribution:last-child ._attribution-link" ) ;
232+ if ( ! link ) {
240233 return ;
241234 }
242235 this . delay ( ( ) => $ . popup ( link . href + location . hash ) ) ;
You can’t perform that action at this time.
0 commit comments