X-Git-Url: https://svn.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/b0c1ded6394ded5256536121116e5968996dd7c7..8c870898f8c5b34896619b4f33be97f0eeb228b6:/skins/photo_lightbox_viewer.js?ds=inline diff --git a/skins/photo_lightbox_viewer.js b/skins/photo_lightbox_viewer.js index dc2547e..f7afe84 100644 --- a/skins/photo_lightbox_viewer.js +++ b/skins/photo_lightbox_viewer.js @@ -13,6 +13,7 @@ var reSelected = /.*selected.*/; Lightbox = function(grid) { this.grid = grid; + this.lastCBChecked = undefined; thisLightbox = this; addListener(this.grid, 'click', function(evt){thisLightbox.mouseClickHandler(evt);}); if (!browser.isGecko){ @@ -99,6 +100,15 @@ Lightbox.prototype.mouseClickHandler = function(evt) { break; } } + } else if(target.tagName === 'INPUT' && target.type === 'checkbox') { + var cb = target; + if (cb.checked) { + cb.setAttribute('checked', 'checked'); + } + else { + cb.removeAttribute('checked'); + } + this.selectCBRange(evt); } }; @@ -124,6 +134,47 @@ Lightbox.prototype.mouseOutHandler = function(evt) { } }; +Lightbox.prototype.getCBIndex = function(cb) { + if (!this.cbIndex) { + // build checkbox index + this.cbIndex = []; + var i, node, c; + var nodes = this.grid.childNodes; + for (i=0 ; i