ticket zoom: move sidebar tabs from scrollbar
This commit is contained in:
parent
282e76d8e8
commit
27fb0f064f
2 changed files with 19 additions and 2 deletions
|
@ -604,7 +604,9 @@ class App.Sidebar extends App.Controller
|
||||||
@toggleTabAction(name)
|
@toggleTabAction(name)
|
||||||
|
|
||||||
render: =>
|
render: =>
|
||||||
@html App.view('generic/sidebar_tabs')( items: @items )
|
@html App.view('generic/sidebar_tabs')
|
||||||
|
items: @items
|
||||||
|
scrollbarWidth: @getScrollBarWidth()
|
||||||
|
|
||||||
# init content callback
|
# init content callback
|
||||||
for item in @items
|
for item in @items
|
||||||
|
@ -620,6 +622,21 @@ class App.Sidebar extends App.Controller
|
||||||
type: 'small'
|
type: 'small'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
getScrollBarWidth: ->
|
||||||
|
$outer = $('<div>').css(
|
||||||
|
visibility: 'hidden'
|
||||||
|
width: 100
|
||||||
|
overflow: 'scroll'
|
||||||
|
).appendTo('body')
|
||||||
|
|
||||||
|
widthWithScroll = $('<div>').css(
|
||||||
|
width: '100%'
|
||||||
|
).appendTo($outer).outerWidth()
|
||||||
|
|
||||||
|
$outer.remove()
|
||||||
|
|
||||||
|
return 100 - widthWithScroll
|
||||||
|
|
||||||
toggleDropdown: (e) ->
|
toggleDropdown: (e) ->
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
$(e.currentTarget).next('.js-actions').find('.dropdown-toggle').dropdown('toggle')
|
$(e.currentTarget).next('.js-actions').find('.dropdown-toggle').dropdown('toggle')
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="tabsSidebar-tabs vertical justified">
|
<div class="tabsSidebar-tabs vertical justified" style="margin-left: -<%- @scrollbarWidth %>px">
|
||||||
<% for item in @items: %>
|
<% for item in @items: %>
|
||||||
<div class="tabsSidebar-tab" data-tab="<%= item.name %>">
|
<div class="tabsSidebar-tab" data-tab="<%= item.name %>">
|
||||||
<%- @Icon(item.icon) %>
|
<%- @Icon(item.icon) %>
|
||||||
|
|
Loading…
Reference in a new issue