web: added open thread view
This commit is contained in:
parent
bd317fa05b
commit
fa9965b2a0
4 changed files with 20 additions and 0 deletions
|
@ -183,6 +183,14 @@ button.nav > img.icon {
|
||||||
.event-content > .info {
|
.event-content > .info {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
.event-content > .info button[role="view-event"] {
|
||||||
|
margin-left: 10px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s linear;
|
||||||
|
}
|
||||||
|
.event:hover .event-content > .info button[role="view-event"] {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
.username {
|
.username {
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: var(--fsReduced);
|
font-size: var(--fsReduced);
|
||||||
|
|
|
@ -67,6 +67,7 @@ function init_home_model() {
|
||||||
},
|
},
|
||||||
notifications: init_timeline('notifications'),
|
notifications: init_timeline('notifications'),
|
||||||
profile: init_timeline('profile'),
|
profile: init_timeline('profile'),
|
||||||
|
thread: init_timeline('thread'),
|
||||||
},
|
},
|
||||||
pow: 0, // pow difficulty target
|
pow: 0, // pow difficulty target
|
||||||
deleted: {},
|
deleted: {},
|
||||||
|
|
|
@ -194,6 +194,9 @@ function render_event(damus, view, ev, opts={}) {
|
||||||
<div class="info">
|
<div class="info">
|
||||||
${render_name(ev.pubkey, profile)}
|
${render_name(ev.pubkey, profile)}
|
||||||
<span class="timestamp">${delta}</span>
|
<span class="timestamp">${delta}</span>
|
||||||
|
<button class="icon" title="View Thread" role="view-event" data-eid="${ev.id}" onclick="click_event(this)">
|
||||||
|
<img class="icon small" src="icon/open-thread.svg"/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="comment">
|
<div class="comment">
|
||||||
${deleted ? render_deleted_comment_body(ev, deleted) : render_comment_body(damus, ev, opts)}
|
${deleted ? render_deleted_comment_body(ev, deleted) : render_comment_body(damus, ev, opts)}
|
||||||
|
|
|
@ -105,3 +105,11 @@ function click_copy_pk(el) {
|
||||||
function click_toggle_follow_user(el) {
|
function click_toggle_follow_user(el) {
|
||||||
alert("sorry not implemented");
|
alert("sorry not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* click_event opens the thread view from the element's specified element id
|
||||||
|
* "dataset.eid".
|
||||||
|
*/
|
||||||
|
function click_event(el) {
|
||||||
|
console.info(`thread to open: ${el.dataset.eid}`);
|
||||||
|
switch_view("thread");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue