Merge branch 'feature/jschatz1/sidebar-features' into 'master'
Feature/jschatz1/sidebar features * Changes sidebar width (290px). * Makes shortcuts for <kbd>j</kbd> and <kbd>k</kbd> keys for next and previous issues. ![Screen_Shot_2016-02-05_at_3.06.22_PM](/uploads/8590be43dc1b9feffd4f32b4e8cb7790/Screen_Shot_2016-02-05_at_3.06.22_PM.png) cc/ @dzaporozhets See merge request !2734
This commit is contained in:
commit
26f3cc41fc
3 changed files with 23 additions and 4 deletions
|
@ -16,12 +16,31 @@ class @ShortcutsIssuable extends ShortcutsNavigation
|
||||||
@replyWithSelectedText()
|
@replyWithSelectedText()
|
||||||
return false
|
return false
|
||||||
)
|
)
|
||||||
|
Mousetrap.bind('j', =>
|
||||||
|
@prevIssue()
|
||||||
|
return false
|
||||||
|
)
|
||||||
|
Mousetrap.bind('k', =>
|
||||||
|
@nextIssue()
|
||||||
|
return false
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if isMergeRequest
|
if isMergeRequest
|
||||||
@enabledHelp.push('.hidden-shortcut.merge_requests')
|
@enabledHelp.push('.hidden-shortcut.merge_requests')
|
||||||
else
|
else
|
||||||
@enabledHelp.push('.hidden-shortcut.issues')
|
@enabledHelp.push('.hidden-shortcut.issues')
|
||||||
|
|
||||||
|
prevIssue: ->
|
||||||
|
$prevBtn = $('.prev-btn')
|
||||||
|
if not $prevBtn.hasClass('disabled')
|
||||||
|
Turbolinks.visit($prevBtn.attr('href'))
|
||||||
|
|
||||||
|
nextIssue: ->
|
||||||
|
$nextBtn = $('.next-btn')
|
||||||
|
if not $nextBtn.hasClass('disabled')
|
||||||
|
Turbolinks.visit($nextBtn.attr('href'))
|
||||||
|
|
||||||
replyWithSelectedText: ->
|
replyWithSelectedText: ->
|
||||||
if window.getSelection
|
if window.getSelection
|
||||||
selected = window.getSelection().toString()
|
selected = window.getSelection().toString()
|
||||||
|
|
|
@ -13,8 +13,8 @@ $list-font-size: 15px;
|
||||||
$sidebar_collapsed_width: 62px;
|
$sidebar_collapsed_width: 62px;
|
||||||
$sidebar_width: 230px;
|
$sidebar_width: 230px;
|
||||||
$gutter_collapsed_width: 62px;
|
$gutter_collapsed_width: 62px;
|
||||||
$gutter_width: 312px;
|
$gutter_width: 290px;
|
||||||
$gutter_inner_width: 280px;
|
$gutter_inner_width: 258px;
|
||||||
$avatar_radius: 50%;
|
$avatar_radius: 50%;
|
||||||
$code_font_size: 13px;
|
$code_font_size: 13px;
|
||||||
$code_line_height: 1.5;
|
$code_line_height: 1.5;
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
= icon('angle-double-right')
|
= icon('angle-double-right')
|
||||||
.issuable-nav.pull-right.btn-group{role: 'group', "aria-label" => '...'}
|
.issuable-nav.pull-right.btn-group{role: 'group', "aria-label" => '...'}
|
||||||
- if has_prev_issuable?(@project, issuable.id)
|
- if has_prev_issuable?(@project, issuable.id)
|
||||||
= link_to 'Prev', issuable_link_prev(@project, issuable), class: 'btn btn-default'
|
= link_to 'Prev', issuable_link_prev(@project, issuable), class: 'btn btn-default prev-btn'
|
||||||
- else
|
- else
|
||||||
%a.btn.btn-default.disabled{href: '#'}
|
%a.btn.btn-default.disabled{href: '#'}
|
||||||
Prev
|
Prev
|
||||||
- if has_next_issuable?(@project, issuable.id)
|
- if has_next_issuable?(@project, issuable.id)
|
||||||
= link_to 'Next', issuable_link_next(@project, issuable), class: 'btn btn-default'
|
= link_to 'Next', issuable_link_next(@project, issuable), class: 'btn btn-default next-btn'
|
||||||
- else
|
- else
|
||||||
%a.btn.btn-default.disabled{href: '#'}
|
%a.btn.btn-default.disabled{href: '#'}
|
||||||
Next
|
Next
|
||||||
|
|
Loading…
Reference in a new issue