From: Eugene Crosser Date: Sun, 31 Aug 2008 09:00:24 +0000 (+0000) Subject: hide scroll bars when going to show mode; some rearrangement X-Git-Tag: 2.00~33 X-Git-Url: http://www.average.org/gitweb/?p=mkgallery.git;a=commitdiff_plain;h=bf4ffba811821b98c05460149d8bf2d8cc807a29 hide scroll bars when going to show mode; some rearrangement --- diff --git a/include/gallery.js b/include/gallery.js index 0809758..4ea3f2d 100644 --- a/include/gallery.js +++ b/include/gallery.js @@ -16,8 +16,9 @@ /* Initialize everything, to be called on domready */ function init_gallery() { - /* List of lists of img variations. Each image variation is a three-element - * array: [width, height, url]. Index of the outer array is the global ID. + /* List of lists of img variations. Each image variation is + * a three-element array: [width, height, url]. Index of the + * outer array is the global ID. * * [ * [ id, title, [ @@ -38,12 +39,12 @@ function init_gallery() { $$('div.varimages').each(function(el,i){ rimgs[el.id] = i; - vimgs[i] = []; + vimgs[i] = [el.id, el.title, []]; el.getElements('a').each(function(ael,j){ dim = /(\d+)[^\d](\d+)/.exec(ael.text); w = dim[1]; h = dim[2]; - vimgs[i][j]=[w,h,ael.href,el.id,el.title]; + vimgs[i][2][j]=[w,h,ael.href]; }); }); diff --git a/include/show.js b/include/show.js index a5f2abd..a614c34 100644 --- a/include/show.js +++ b/include/show.js @@ -52,16 +52,15 @@ var Show = new Class({ this.controls.registershow(this); window.addEvent('resize', this.resizer.bind(this)) - window.addEvent('scroll', this.scroller.bind(this)) }, + /* event handler for window resize */ + resizer: function(){ alert('show.resizer called'); }, - scroller: function(){ - alert('show.scroller called'); - }, + /* prev, play, stop, next, exit, comm are methods for button presses */ prev: function(){ this.controls.info(-1,this.vimgs.length, @@ -85,20 +84,25 @@ var Show = new Class({ '','next called'); }, - start: function(id, play){ - this.options.cbStart(); - /* real job here */ - return false; /* tao make it usable from href links */ - }, - exit: function(){ this.options.cbExit(); }, comm: function(){ - alert('show.comm called, do nothing'); + /* alert('show.comm called, do nothing'); */ }, + /* Entry point: called to start doing things */ + + start: function(id, play){ + this.options.cbStart(); + alert('starting at '+id+', play='+play); + /* real job here */ + return false; /* to make it usable from href links */ + }, + + /* "Private" methods to do the real job */ + }); Show.implement(new Options); Show.implement(new Events); diff --git a/include/showwin.js b/include/showwin.js index 3fac7f6..c900ab4 100644 --- a/include/showwin.js +++ b/include/showwin.js @@ -68,15 +68,29 @@ var showWindow = new Class({ show: function(){ if (this.options.tohide) { - this.options.tohide.setStyle('display', 'none'); + this.hiddenstyles = this.options.tohide.getStyles( + 'display' + ); + this.options.tohide.setStyles({ + display: 'none', + }); } + this.bodystyles = document.body.getStyles( + 'overflow', 'overflow-x', 'overflow-y' + ); + document.body.setStyles({ + overflow: 'hidden', + 'overflow-x': 'hidden', + 'overflow-y': 'hidden', + }); this.container.setStyle('display', 'block'); }, hide: function(){ if (this.options.tohide) { - this.options.tohide.setStyle('display', 'block'); + this.options.tohide.setStyles(this.hiddenstyles); } + document.body.setStyles(this.bodystyles); this.container.setStyle('display', 'none'); } })