FIX: avoid horizontal scrollbar on narrow windows
This commit is contained in:
parent
83efde79f0
commit
4758144f6a
|
@ -9,6 +9,32 @@ import PinnedButton from 'discourse/components/pinned-button';
|
||||||
import TopicNotificationsButton from 'discourse/components/topic-notifications-button';
|
import TopicNotificationsButton from 'discourse/components/topic-notifications-button';
|
||||||
import DiscourseContainerView from 'discourse/views/container';
|
import DiscourseContainerView from 'discourse/views/container';
|
||||||
|
|
||||||
|
const MainPanel = Discourse.ContainerView.extend({
|
||||||
|
elementId: 'topic-footer-main-buttons',
|
||||||
|
topicBinding: 'controller.content',
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this._super();
|
||||||
|
|
||||||
|
const topic = this.get('topic');
|
||||||
|
if (!topic.get('isPrivateMessage')) {
|
||||||
|
// We hide some controls from private messages
|
||||||
|
if (this.get('topic.details.can_invite_to')) {
|
||||||
|
this.attachViewClass(InviteReplyButton);
|
||||||
|
}
|
||||||
|
this.attachViewClass(BookmarkButton);
|
||||||
|
this.attachViewClass(ShareButton);
|
||||||
|
if (this.get('topic.details.can_flag_topic')) {
|
||||||
|
this.attachViewClass(FlagTopicButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.get('topic.details.can_create_post')) {
|
||||||
|
this.attachViewClass(ReplyButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
export default DiscourseContainerView.extend({
|
export default DiscourseContainerView.extend({
|
||||||
elementId: 'topic-footer-buttons',
|
elementId: 'topic-footer-buttons',
|
||||||
topicBinding: 'controller.content',
|
topicBinding: 'controller.content',
|
||||||
|
@ -26,20 +52,9 @@ export default DiscourseContainerView.extend({
|
||||||
if (Discourse.User.currentProp("staff")) {
|
if (Discourse.User.currentProp("staff")) {
|
||||||
this.attachViewClass(TopicAdminMenuButton);
|
this.attachViewClass(TopicAdminMenuButton);
|
||||||
}
|
}
|
||||||
if (!topic.get('isPrivateMessage')) {
|
|
||||||
// We hide some controls from private messages
|
this.attachViewWithArgs(viewArgs, MainPanel);
|
||||||
if (this.get('topic.details.can_invite_to')) {
|
|
||||||
this.attachViewClass(InviteReplyButton);
|
|
||||||
}
|
|
||||||
this.attachViewClass(BookmarkButton);
|
|
||||||
this.attachViewClass(ShareButton);
|
|
||||||
if (this.get('topic.details.can_flag_topic')) {
|
|
||||||
this.attachViewClass(FlagTopicButton);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.get('topic.details.can_create_post')) {
|
|
||||||
this.attachViewClass(ReplyButton);
|
|
||||||
}
|
|
||||||
this.attachViewWithArgs(viewArgs, PinnedButton);
|
this.attachViewWithArgs(viewArgs, PinnedButton);
|
||||||
this.attachViewWithArgs(viewArgs, TopicNotificationsButton);
|
this.attachViewWithArgs(viewArgs, TopicNotificationsButton);
|
||||||
|
|
||||||
|
|
|
@ -228,34 +228,27 @@ a:hover.reply-new {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all
|
@media all
|
||||||
and (max-width : 940px) {
|
and (max-width : 1000px) {
|
||||||
|
|
||||||
#topic-progress, #topic-progress-expanded {
|
#topic-progress, #topic-progress-expanded {
|
||||||
left: 295px;
|
right: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media all
|
|
||||||
and (max-width : 870px) {
|
|
||||||
|
|
||||||
#topic-progress, #topic-progress-expanded {
|
|
||||||
left: 210px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media all
|
|
||||||
and (max-width : 724px) {
|
|
||||||
|
|
||||||
#topic-progress-wrapper {
|
#topic-progress-wrapper {
|
||||||
right: 0;
|
right: 160px;
|
||||||
#topic-progress, #topic-progress-expanded { left: auto; right: 145px; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#topic-progress-wrapper.docked {
|
||||||
|
right: 152px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#topic-footer-main-buttons {
|
||||||
|
max-width: 70%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media all
|
@media all
|
||||||
and (max-width : 485px) {
|
and (max-width : 485px) {
|
||||||
|
|
||||||
|
@ -264,4 +257,7 @@ and (max-width : 485px) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#topic-footer-main-buttons {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue