scrollable panels

This commit is contained in:
jean-emmanuel 2015-09-25 13:55:43 +02:00
parent 1e7e18eef8
commit 6b246b5ec8
4 changed files with 18 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -64,6 +64,7 @@ init = function(session,callback) {
// horizontal scrolling & zoom with mousewheel
// if shift is pressed (native), or if there is no vertical scrollbar,
// or if mouse is on h-scrollbar
var scrollbarHeight = 10
var contentPanels = $('.content')
$('.tab').on('mousewheel',function(e) {
// console.log(e)
@ -75,9 +76,8 @@ init = function(session,callback) {
contentPanels.css('top',60+'rem')
} else {
var scrollbar = 10
var h = $('#container').innerHeight()-scrollbar-$(this).parents('.tab').length*5
if ($(this).get(0).scrollHeight+scrollbar == $(this).height()) {
var h = $('#container').innerHeight()-scrollbarHeight-$(this).parents('.tab').length*5
if ($(this).get(0).scrollHeight+scrollbarHeight == $(this).height()) {
var scroll = e.originalEvent.deltaY || e.originalEvent.deltaX
$(this).scrollLeft($(this).scrollLeft()+scroll)
e.preventDefault()
@ -86,14 +86,22 @@ init = function(session,callback) {
e.preventDefault()
}
}
})
$('.panel').on('mousewheel',function(e) {
if (!e.ctrlKey) {
var h = $(this).parent().innerHeight()-scrollbarHeight-$(this).parents('.tab').length*5
if ($(this).get(0).scrollHeight+scrollbarHeight == $(this).parent().height()) {
var scroll = e.originalEvent.deltaY || e.originalEvent.deltaX
$(this).scrollLeft($(this).scrollLeft()+scroll)
e.preventDefault()
}
}
})
// sidepanel
$('#container').append('\
<a id="open-toggle">'+icon('navicon')+'</a>\
')

View file

@ -564,7 +564,7 @@ form {
overflow: hidden;
position:relative;
font-size:13rem;
padding:35rem 0 0;
padding:35rem 1px 0;
vertical-align:top;
border: 6rem solid transparent;
border-width:6rem 0;
@ -713,6 +713,7 @@ form {
.panel {
height:100%;
padding:6rem 0;
overflow: auto;
> .widget {
border:0;
}

View file

@ -6,7 +6,7 @@
label:false,
top:40,
left:200,
height:400,
height:400,width:300,
widgets:[
// these are fader (all options to defaults)
{