mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 12:35:25 +08:00
UX: use down chevron icon to expand "show more links.."
This commit is contained in:
parent
fff5e2c3a5
commit
6d09fbde44
|
@ -18,10 +18,15 @@ function renderParticipants(userFilters, participants) {
|
|||
createWidget('topic-map-show-links', {
|
||||
tagName: 'div.link-summary',
|
||||
html(attrs) {
|
||||
return h('a', I18n.t('topic_map.links_shown', { totalLinks: attrs.totalLinks }));
|
||||
return h('span', this.attach('button', {
|
||||
title: 'topic_map.links_shown',
|
||||
icon: 'chevron-down',
|
||||
action: 'showLinks',
|
||||
className: 'btn'
|
||||
}));
|
||||
},
|
||||
|
||||
click() {
|
||||
showLinks() {
|
||||
this.sendWidgetAction('showAllLinks');
|
||||
}
|
||||
});
|
||||
|
@ -179,7 +184,7 @@ createWidget('topic-map-expanded', {
|
|||
];
|
||||
|
||||
if (!state.allLinksShown && links.length < attrs.topicLinks.length) {
|
||||
showAllLinksContent.push(this.attach('topic-map-show-links', { totalLinks: attrs.topicLinks.length }));
|
||||
showAllLinksContent.push(this.attach('topic-map-show-links'));
|
||||
}
|
||||
|
||||
const section = h('section.links', showAllLinksContent);
|
||||
|
|
|
@ -419,6 +419,16 @@ a.star {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.link-summary .btn {
|
||||
color: dark-light-choose(scale-color($primary, $lightness: 60%), scale-color($secondary, $lightness: 40%));
|
||||
background: blend-primary-secondary(5%);
|
||||
width: 100%;
|
||||
&:hover {
|
||||
color: $primary;
|
||||
background: dark-light-diff($primary, $secondary, 90%, -80%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#topic-footer-buttons {
|
||||
|
|
|
@ -309,6 +309,12 @@ a.star {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.link-summary .btn {
|
||||
color: dark-light-choose(scale-color($primary, $lightness: 60%), scale-color($secondary, $lightness: 40%));
|
||||
background: blend-primary-secondary(5%);
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#topic-footer-buttons {
|
||||
|
|
|
@ -765,7 +765,7 @@ widgetTest("topic map - links", {
|
|||
assert.equal(this.$('.topic-map-expanded .topic-link').length, 5, 'it limits the links displayed');
|
||||
});
|
||||
|
||||
click('.link-summary a');
|
||||
click('.link-summary button');
|
||||
andThen(() => {
|
||||
assert.equal(this.$('.topic-map-expanded .topic-link').length, 6, 'all links now shown');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user