File tree Expand file tree Collapse file tree 5 files changed +46
-7
lines changed Expand file tree Collapse file tree 5 files changed +46
-7
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ msgstr ""
296296msgid "UnfollowFollow"
297297msgstr ""
298298
299- #: Follow.html
299+ #: Follow.html lists/list_follow.html
300300msgid "Follow"
301301msgstr ""
302302
@@ -6301,7 +6301,11 @@ msgid "You"
63016301msgstr ""
63026302
63036303#: lists/list_follow.html
6304- msgid "Private"
6304+ msgid "This patron has not enabled following"
6305+ msgstr ""
6306+
6307+ #: lists/list_follow.html
6308+ msgid "🔒︎"
63056309msgstr ""
63066310
63076311#: lists/list_follow.html
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ export function initListsSection(elem) {
2020 fetchPartials ( ids . work , ids . edition )
2121 . then ( ( resp ) => {
2222 // Check response code, continue if not 4XX or 5XX
23-
2423 return resp . json ( )
2524 } )
2625 . then ( ( data ) => {
@@ -43,6 +42,8 @@ export function initListsSection(elem) {
4342 showAllLink . classList . remove ( 'hidden' )
4443 }
4544 }
45+ // Initialize private buttons after content is loaded
46+ initPrivateButtonsAfterLoad ( listSection )
4647 } )
4748 }
4849 } )
@@ -55,6 +56,20 @@ export function initListsSection(elem) {
5556 intersectionObserver . observe ( elem )
5657}
5758
59+ /**
60+ * Initialize private buttons after the lists section has been loaded
61+ * @param {HTMLElement } container - The container that now has the loaded content
62+ */
63+ function initPrivateButtonsAfterLoad ( container ) {
64+ const privateButtons = container . querySelectorAll ( '.list-follow-card__private-button' )
65+ if ( privateButtons . length > 0 ) {
66+ import ( /* webpackChunkName: "private-buttons" */ './private-button' )
67+ . then ( module => {
68+ module . initPrivateButtons ( privateButtons )
69+ } )
70+ }
71+ }
72+
5873async function fetchPartials ( workId , editionId ) {
5974 const params = { }
6075 if ( workId ) {
Original file line number Diff line number Diff line change 1+ import { FadingToast } from './Toast'
2+
3+ export function initPrivateButtons ( buttons ) {
4+ buttons . forEach ( button => {
5+ button . addEventListener ( 'click' , ( event ) => {
6+ event . preventDefault ( ) ;
7+ const toast = new FadingToast ( 'This patron has not enabled following' , null , 3000 ) ;
8+ toast . show ( ) ;
9+
10+ } ) ;
11+ } ) ;
12+ }
Original file line number Diff line number Diff line change 5353 $if is_public:
5454 $:render_follow_button(owner_username, is_subscribed)
5555 $else:
56- < button class ="list-follow-card__private-button " disabled >
57- < span class ="pvt-text "> $_('Private')</ span >
58- </ button >
56+ < div title ="$_('This patron has not enabled following') ">
57+ < button class ="list-follow-card__private-button " >
58+ < span class ="pvt-icon "> $_('🔒︎')</ span >
59+ < span class ="pvt-text "> $_('Follow')</ span >
60+ </ button >
61+ </ div >
5962 </ div >
6063 </ div >
6164 $else:
Original file line number Diff line number Diff line change 131131 background-color : @grey ;
132132 border : none ;
133133 cursor : not-allowed ;
134- pointer-events : none ;
134+ pointer-events : auto ;
135135 display : flex ;
136136 justify-content : center ;
137137 align-items : center ;
144144 box-shadow : none ; // Remove default shadow if present
145145 margin : 0 ;
146146 letter-spacing : 0.2px ;
147+ margin-top : 1px ;
148+ }
149+ .pvt-icon {
150+ color : @white ;
151+ font-size : 14px ;
147152 }
148153 }
149154 &__title {
You can’t perform that action at this time.
0 commit comments