Merge branch '28377-add-edit-button-to-mobile-file-view' into 'master'

Add edit button to mobile file view

Closes #28377

See merge request gitlab-org/gitlab-ce!15199
This commit is contained in:
Clement Ho 2017-11-22 20:31:53 +00:00
commit f553405901
4 changed files with 30 additions and 1 deletions

View file

@ -364,6 +364,18 @@ span.idiff {
float: none;
}
}
@media (max-width: $screen-xs-max) {
display: block;
.file-actions {
white-space: normal;
.btn-group {
padding-top: 5px;
}
}
}
}
.is-stl-loading {

View file

@ -2,7 +2,7 @@
.js-file-title.file-title-flex-parent
= render 'projects/blob/header_content', blob: blob
.file-actions.hidden-xs
.file-actions
= render 'projects/blob/viewer_switcher', blob: blob unless blame
.btn-group{ role: "group" }<

View file

@ -0,0 +1,5 @@
---
title: Add edit button to mobile file view
merge_request: 15199
author: Travis Miller
type: added

View file

@ -1,6 +1,8 @@
require 'spec_helper'
feature 'File blob', :js do
include MobileHelpers
let(:project) { create(:project, :public, :repository) }
def visit_blob(path, anchor: nil, ref: 'master')
@ -30,6 +32,16 @@ feature 'File blob', :js do
expect(page).to have_link('Open raw')
end
end
it 'displays file actions on all screen sizes' do
file_actions_selector = '.file-actions'
resize_screen_sm
expect(page).to have_selector(file_actions_selector, visible: true)
resize_screen_xs
expect(page).to have_selector(file_actions_selector, visible: true)
end
end
context 'Markdown file' do