+11
-16
@@ -370,7 +370,7 @@ class StepForgeApp {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
className: this.state.selectMode ? 'primary' : '',
|
className: this.state.selectMode ? 'primary' : '',
|
||||||
onClick: () => this.toggleSelectMode(),
|
onClick: () => this.toggleSelectMode(),
|
||||||
}, this.state.selectMode ? 'Selecting' : 'Select') : null,
|
}, 'Select') : null,
|
||||||
),
|
),
|
||||||
el('div.row', { style: { justifyContent: 'space-between', marginBottom: '14px' } },
|
el('div.row', { style: { justifyContent: 'space-between', marginBottom: '14px' } },
|
||||||
el('div', {},
|
el('div', {},
|
||||||
@@ -526,7 +526,7 @@ class StepForgeApp {
|
|||||||
const selected = this.state.selectedGuides.has(guide.guideId);
|
const selected = this.state.selectedGuides.has(guide.guideId);
|
||||||
const description = (guide.descriptionHtml || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
|
const description = (guide.descriptionHtml || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
|
||||||
const card = el('div.guide-card', {
|
const card = el('div.guide-card', {
|
||||||
className: `guide-card${selectMode ? ' selectable' : ''}${selected ? ' selected' : ''}`,
|
className: `guide-card${selected ? ' selected' : ''}`,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (selectMode) this.toggleGuideSelection(guide.guideId);
|
if (selectMode) this.toggleGuideSelection(guide.guideId);
|
||||||
else this.openGuide(guide.guideId);
|
else this.openGuide(guide.guideId);
|
||||||
@@ -537,20 +537,15 @@ class StepForgeApp {
|
|||||||
this.guideContextMenu(e, guide);
|
this.guideContextMenu(e, guide);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
selectMode
|
el('div.fav', {
|
||||||
? el('input.select-check', {
|
className: `fav${guide.favorite ? ' on' : ''}`,
|
||||||
type: 'checkbox',
|
onClick: async (e) => {
|
||||||
checked: selected,
|
e.stopPropagation();
|
||||||
onClick: (e) => { e.stopPropagation(); this.toggleGuideSelection(guide.guideId); },
|
if (selectMode) return;
|
||||||
})
|
await api.library.setFavorite({ guideId: guide.guideId, favorite: !guide.favorite });
|
||||||
: el('div.fav', {
|
await this.refreshLibrary();
|
||||||
className: `fav${guide.favorite ? ' on' : ''}`,
|
},
|
||||||
onClick: async (e) => {
|
}, '★'),
|
||||||
e.stopPropagation();
|
|
||||||
await api.library.setFavorite({ guideId: guide.guideId, favorite: !guide.favorite });
|
|
||||||
await this.refreshLibrary();
|
|
||||||
},
|
|
||||||
}, '★'),
|
|
||||||
el('h4', {}, guide.title || 'Untitled guide'),
|
el('h4', {}, guide.title || 'Untitled guide'),
|
||||||
el('div.meta', {},
|
el('div.meta', {},
|
||||||
el('span.badge', {}, badgeText),
|
el('span.badge', {}, badgeText),
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ body {
|
|||||||
|
|
||||||
#app { display: flex; flex-direction: column; height: 100vh; }
|
#app { display: flex; flex-direction: column; height: 100vh; }
|
||||||
#view { flex: 1; min-height: 0; display: flex; }
|
#view { flex: 1; min-height: 0; display: flex; }
|
||||||
|
#view > * { flex: 1; min-height: 0; display: flex; }
|
||||||
.hidden { display: none !important; }
|
.hidden { display: none !important; }
|
||||||
.muted { color: var(--muted); font-size: 12px; }
|
.muted { color: var(--muted); font-size: 12px; }
|
||||||
|
|
||||||
@@ -267,14 +268,6 @@ kbd {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
color: #f5a524;
|
color: #f5a524;
|
||||||
}
|
}
|
||||||
.guide-card .select-check {
|
|
||||||
position: absolute;
|
|
||||||
top: 11px;
|
|
||||||
right: 12px;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.guide-card .muted { font-size: 12px; margin-top: auto; padding-top: 8px; }
|
.guide-card .muted { font-size: 12px; margin-top: auto; padding-top: 8px; }
|
||||||
.guide-card .snippet,
|
.guide-card .snippet,
|
||||||
.qa-item .snippet { color: var(--muted); }
|
.qa-item .snippet { color: var(--muted); }
|
||||||
|
|||||||
Reference in New Issue
Block a user