You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 05-06-2013 16:08:41

Timon
Contributors
From: Poland
Registered: 25-05-2013
Posts: 44
Website

Change scrolling v/h

Hey,

Is it possible to change scrolling from horizontal to vertical but only when panel is open? I got 13 tiles in panel, guess i'd be easier if scrolling would be switched then and switched back when closed.

Offline

#2 05-06-2013 19:45:43

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Change scrolling v/h

Replacing plugins/panels/desktop.js by

$(document).on("click","a[href^='panels/']",function(event){
	event.preventDefault();
	$this = $(this);
	$panel = $("#panel");
	
	$panel.stop().show().animate({right:0},500, "easeOutCubic");
	$("#panelLoader").show()
	
	if($("#panel_"+encodeURIComponent($this.attr("href").replace(/./g,"_").replace(/\//g,"_slash-")).replace(/%/g,"_")).length>0){
		$("#panelContent, .preloadedPanel, #panelLoader").hide();
		$("#panel_"+encodeURIComponent($this.attr("href").replace(/./g,"_").replace(/\//g,"_slash-")).replace(/%/g,"_")).fadeIn(300);
		transformLinks();
		scrolling = true;
	}else{
		$.ajax($this.attr("href")).success(function(newContent,textStatus){	
			$("#panelContent, .preloadedPanel").hide()
			$("#panelLoader").fadeOut(200)
			$("#panelContent").html(newContent).fadeIn(300);
			transformLinks();
			scrolling = true;
		});
	}	
	if(hidePanelOnClick){
		$(document).bind("click.hidepanel",function(){
			hidePanel();
			$(document).unbind("click.hidepanel");
		});
		 $panel.click(function(event){
	    	 event.stopPropagation();
	 	});
	}
	return false;
});
hidePanel = function(){
	scrolling = false;
	$("#panel").animate({right:-$("#panel").width()-20},500,"easeOutCubic",function(){
		$(this).hide();
	});
}

Should work (didn't test). Don't know which side effects it'll have and it's quite dirty...

Offline

#3 05-06-2013 23:13:15

Timon
Contributors
From: Poland
Registered: 25-05-2013
Posts: 44
Website

Re: Change scrolling v/h

No, sorry. It's not working.

No effect in Chrome.
Turns off even horizontal scrolling in IE while panel open.

Last edited by Timon (05-06-2013 23:13:33)

Offline

#4 11-06-2013 12:58:01

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Change scrolling v/h

Then I misunderstood you. Do you want to have all the tiles rearranged in vertical position (like the mobile site) instead of horizontal when a sidepanel is opened? I tought you meant do disable scrolling of the groups when the panel is open.

Offline

#5 11-06-2013 13:50:02

Timon
Contributors
From: Poland
Registered: 25-05-2013
Posts: 44
Website

Re: Change scrolling v/h

No, you probably understood me very well. I dont want to rearrange tiles, I like it horizontal. Tiles are good the way it is. It's all about panel. It's too high, even in full hd res and when it opens, we can't see bottom tiles (i got 13 tiles there). So when it pops up, vertical scroll shows as well, but when we use mouse scroll, panel wont scroll up/down, but whole page moves left/right. I used the code you gave me, but there was no effect in Chrome (it was still page moving, not panel when mouse scrolling) and turned off whole scrolling in IE while panel open.

Offline

#6 12-06-2013 01:37:24

Timon
Contributors
From: Poland
Registered: 25-05-2013
Posts: 44
Website

Re: Change scrolling v/h

I thought I will skip that problem with setting wider sidepanel but so I could've make 3 columns instead of 2 and all my tiles'd fit but when I set

$sidebar["pokoje"] = array("pos"=>"left","size"=>2,"full_height"=>false

"size"=>3 or more, even 8(!) sidepanel isn't that wide I set... It's about 2,5.. no matter size I set. If it's easier to solve then it's fine.. I can have 3 columns smile.

Offline

#7 12-06-2013 11:09:14

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: Change scrolling v/h

You need to set both the sidebar wider and the panel width in plugins/panels/settings.php

And for the scroll; I fixed it. I've implemented it that the sidebar scrolls, wherever your mouse is on the page. (seems the most logic to me)

To fix it, open the js/main.js , go to around line 427 and replace the whole mousewheelcheck thing with:

/*Check mousewheel */
	if(!mouseScroll || $group.direction == "vertical" || $page.current != 'home' || $page.layout == "column" || (disableGroupScrollingWhenVerticalScroll && $(document).height()>$(window).height())){	/*Scrolling on pages and home */
		$(document).unbind("mousewheel");	
	}else{
		$(document).bind("mousewheel", function(event, delta) { /* Mouse scroll to move tilepages */		
			if(!scrolling && $("#panel").css("display")=="none"){
				 if(delta>0){
					 $group.goLeft();
				 }else{
					 $group.goRight();
				 }
			}else{
				if(delta>0){
					 $("#panel").scrollTop($("#panel").scrollTop()-20);
				 }else{
					 $("#panel").scrollTop($("#panel").scrollTop()+20);
				 }
			}
			event.preventDefault();
		});
	}
	

The thing that I posted about plugins/panels/desktop.js is still needed.

Offline

#8 12-06-2013 15:43:20

vijfwinkel
Contributors
Registered: 09-05-2013
Posts: 96

Re: Change scrolling v/h

mmm, i change these things and now my template scrolls vertical?


better a dumb question than no question at all.
maybe there are no dumb questions, only dumb answers

Offline

#9 12-06-2013 18:13:16

vijfwinkel
Contributors
Registered: 09-05-2013
Posts: 96

Re: Change scrolling v/h

i changed it back


better a dumb question than no question at all.
maybe there are no dumb questions, only dumb answers

Offline

Board footer

Powered by FluxBB