]> www.average.org Git - mkgallery.git/commitdiff
hide scroll bars when going to show mode; some rearrangement
authorEugene Crosser <crosser@average.org>
Sun, 31 Aug 2008 09:00:24 +0000 (09:00 +0000)
committerEugene Crosser <crosser@average.org>
Sun, 31 Aug 2008 09:00:24 +0000 (09:00 +0000)
include/gallery.js
include/show.js
include/showwin.js

index 08097589d49f25d9a5647556e9a46c9ae6d89e15..4ea3f2d638d5b9251e4fe29d7b9b291f474d9d1d 100644 (file)
@@ -16,8 +16,9 @@
 /* Initialize everything, to be called on domready */
 function init_gallery() {
 
 /* 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, [
         *
         * [
         *  [ id, title, [
@@ -38,12 +39,12 @@ function init_gallery() {
 
        $$('div.varimages').each(function(el,i){
                rimgs[el.id] = i;
 
        $$('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];
                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];
                });
        });
 
                });
        });
 
index a5f2abd5ddea8a5ac0e09e70f800416f76a767b3..a614c344b378f4e173125ce566d3884949e0c9d1 100644 (file)
@@ -52,16 +52,15 @@ var Show = new Class({
                this.controls.registershow(this);
 
                window.addEvent('resize', this.resizer.bind(this))
                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');
        },
 
        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,
 
        prev: function(){
                this.controls.info(-1,this.vimgs.length,
@@ -85,20 +84,25 @@ var Show = new Class({
                                '<ref>','next called');
        },
 
                                '<ref>','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(){
        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);
 });
 Show.implement(new Options);
 Show.implement(new Events);
index 3fac7f6b7de60a29bccb29fa38516cc41447cf0e..c900ab4decbd10e92094e6e57f4f7aee04561e3f 100644 (file)
@@ -68,15 +68,29 @@ var showWindow = new Class({
 
        show: function(){
                if (this.options.tohide) {
 
        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.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');
        }
 })
                this.container.setStyle('display', 'none');
        }
 })