Improve transition between doc list and doc picker

pull/417/merge
Thibaut Courouble 9 years ago
parent a02dd3b7b4
commit 4becd25605

@ -314,6 +314,13 @@ $.framify = (fn, obj) ->
else else
fn fn
$.requestAnimationFrame = (fn) ->
if window.requestAnimationFrame
requestAnimationFrame(fn)
else
setTimeout(fn, 0)
return
# #
# Miscellaneous # Miscellaneous
# #

@ -20,7 +20,6 @@ class app.views.DocPicker extends app.View
activate: -> activate: ->
if super if super
@render() @render()
@findByTag('input')?.focus()
app.appCache?.on 'progress', @onAppCacheProgress app.appCache?.on 'progress', @onAppCacheProgress
$.on @el, 'focus', @onDOMFocus, true $.on @el, 'focus', @onDOMFocus, true
return return
@ -47,9 +46,9 @@ class app.views.DocPicker extends app.View
@html html + @tmpl('sidebarPickerNote') + @tmpl('sidebarSave') @html html + @tmpl('sidebarPickerNote') + @tmpl('sidebarSave')
@refreshElements() @refreshElements()
@delay -> # trigger animation $.requestAnimationFrame =>
@el.offsetWidth
@addClass '_in' @addClass '_in'
@findByTag('input')?.focus()
return return
renderVersions: (docs) -> renderVersions: (docs) ->

@ -12,6 +12,7 @@
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: scroll;
background: $sidebarBackground; background: $sidebarBackground;
background-clip: content-box;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
-ms-overflow-style: none; // IE 10 doesn't support pointer-events -ms-overflow-style: none; // IE 10 doesn't support pointer-events
@extend %user-select-none; @extend %user-select-none;
@ -339,10 +340,12 @@
// //
._list-picker { ._list-picker {
> ._list, > ._list-item {
opacity: 0; opacity: 0;
transition: .2s; transition: .2s;
}
&._in { > ._list, > ._list-item { opacity: 1; } }
&._in { opacity: 1; }
._list-item { cursor: pointer; } ._list-item { cursor: pointer; }
._list-sub > ._list-item { padding-left: 2.375rem; } ._list-sub > ._list-item { padding-left: 2.375rem; }
} }
@ -378,6 +381,8 @@
width: $sidebarWidth; width: $sidebarWidth;
background: $sidebarBackground; background: $sidebarBackground;
box-shadow: inset -1px 0 $sidebarBorder; box-shadow: inset -1px 0 $sidebarBorder;
-webkit-transform: translateZ(0);
transform: translateZ(0);
@media #{$mediumScreen} { width: $sidebarMediumWidth; } @media #{$mediumScreen} { width: $sidebarMediumWidth; }

Loading…
Cancel
Save