Browse Source

Add scroll to top

pull/1129/head
jlukic 10 years ago
parent
commit
542f455de9
2 changed files with 8 additions and 4 deletions
  1. 7
      src/definitions/modules/sidebar.js
  2. 5
      src/definitions/modules/sidebar.less

7
src/definitions/modules/sidebar.js

@ -111,7 +111,6 @@ $.fn.sidebar = function(parameters) {
bind: { bind: {
clickaway: function() { clickaway: function() {
$context $context
.on('scroll' + eventNamespace, module.event.preventScroll)
.on('click' + eventNamespace, module.event.clickaway) .on('click' + eventNamespace, module.event.clickaway)
.on('touchend' + eventNamespace, module.event.clickaway) .on('touchend' + eventNamespace, module.event.clickaway)
; ;
@ -137,6 +136,7 @@ $.fn.sidebar = function(parameters) {
convert: { convert: {
toAbsolute: function() { toAbsolute: function() {
window.scrollTo(0, 0);
/* var /* var
scrollTop = $(document).scrollTop() scrollTop = $(document).scrollTop()
; ;
@ -152,6 +152,7 @@ $.fn.sidebar = function(parameters) {
;*/ ;*/
}, },
toFixed: function() { toFixed: function() {
window.scrollTo(0, 0);
/* $fixed /* $fixed
.css({ .css({
transform: 'translate3d(0, 0px, 0px)' transform: 'translate3d(0, 0px, 0px)'
@ -686,8 +687,8 @@ $.fn.sidebar.settings = {
verbose : false, verbose : false,
performance : false, performance : false,
animation : 'safe',
mobileAnimation : 'safe',
animation : 'scale down',
mobileAnimation : 'slide along',
context : 'body', context : 'body',
useCSS : true, useCSS : true,

5
src/definitions/modules/sidebar.less

@ -41,7 +41,6 @@
will-change: transform; will-change: transform;
overflow-y: auto !important; overflow-y: auto !important;
-webkit-overflow-scrolling: touch;
} }
/*-------------- /*--------------
@ -115,6 +114,10 @@
opacity: 1 !important; opacity: 1 !important;
} }
.pushable.pushed > .visible.sidebar {
-webkit-overflow-scrolling: touch;
}
/*.pushable.hide > .pusher > .page *, /*.pushable.hide > .pusher > .page *,
.pushable.show > .pusher > .page *, .pushable.show > .pusher > .page *,
.pushable.pushed > .pusher > .page * { .pushable.pushed > .pusher > .page * {

Loading…
Cancel
Save