BigW Consortium Gitlab

Commit 7125c966 by Alfredo Sumaran

Merge branch 'right-sidebar-closed-default-mobile' into 'master'

Set the issuable sidebar to remain collapsed on mobile devices Closes #28086 See merge request !10323
parents c57e66be a63b18b1
...@@ -211,6 +211,14 @@ $(function () { ...@@ -211,6 +211,14 @@ $(function () {
} }
}); });
if (bootstrapBreakpoint === 'xs') {
const $rightSidebar = $('aside.right-sidebar, .page-with-sidebar');
$rightSidebar
.removeClass('right-sidebar-expanded')
.addClass('right-sidebar-collapsed');
}
// prevent default action for disabled buttons // prevent default action for disabled buttons
$('.btn').click(function(e) { $('.btn').click(function(e) {
if ($(this).hasClass('disabled')) { if ($(this).hasClass('disabled')) {
......
---
title: Set the issuable sidebar to remain closed for mobile devices
merge_request:
author:
...@@ -120,6 +120,20 @@ feature 'Issue Sidebar', feature: true do ...@@ -120,6 +120,20 @@ feature 'Issue Sidebar', feature: true do
end end
end end
context 'as a allowed mobile user', js: true do
before do
project.team << [user, :developer]
resize_screen_xs
visit_issue(project, issue)
end
context 'mobile sidebar' do
it 'collapses the sidebar for small screens' do
expect(page).not_to have_css('aside.right-sidebar.right-sidebar-collapsed')
end
end
end
context 'as a guest' do context 'as a guest' do
before do before do
project.team << [user, :guest] project.team << [user, :guest]
......
module MobileHelpers module MobileHelpers
def resize_screen_xs
resize_window(767, 768)
end
def resize_screen_sm def resize_screen_sm
resize_window(900, 768) resize_window(900, 768)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment