mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 05:13:44 +08:00
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 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({
|
||||
elementId: 'topic-footer-buttons',
|
||||
topicBinding: 'controller.content',
|
||||
|
@ -26,20 +52,9 @@ export default DiscourseContainerView.extend({
|
|||
if (Discourse.User.currentProp("staff")) {
|
||||
this.attachViewClass(TopicAdminMenuButton);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
this.attachViewWithArgs(viewArgs, MainPanel);
|
||||
|
||||
this.attachViewWithArgs(viewArgs, PinnedButton);
|
||||
this.attachViewWithArgs(viewArgs, TopicNotificationsButton);
|
||||
|
||||
|
|
|
@ -228,34 +228,27 @@ a:hover.reply-new {
|
|||
}
|
||||
|
||||
@media all
|
||||
and (max-width : 940px) {
|
||||
and (max-width : 1000px) {
|
||||
|
||||
#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 {
|
||||
right: 0;
|
||||
#topic-progress, #topic-progress-expanded { left: auto; right: 145px; }
|
||||
right: 160px;
|
||||
}
|
||||
|
||||
#topic-progress-wrapper.docked {
|
||||
right: 152px;
|
||||
}
|
||||
|
||||
#topic-footer-main-buttons {
|
||||
max-width: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media all
|
||||
and (max-width : 485px) {
|
||||
|
||||
|
@ -264,4 +257,7 @@ and (max-width : 485px) {
|
|||
}
|
||||
|
||||
|
||||
#topic-footer-main-buttons {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user