comparison client/digitallibrary/jquery/jquery.digilib.js @ 699:09f61af0a6dd jquery

re-created toggle for morebuttons (more = null)
author robcast
date Thu, 27 Jan 2011 17:29:41 +0100
parents 215ef40435c8
children df8017bb4708
comparison
equal deleted inserted replaced
698:215ef40435c8 699:09f61af0a6dd
132 }, 132 },
133 scale : { 133 scale : {
134 onclick : "javascript:toggleScaleMenu()", 134 onclick : "javascript:toggleScaleMenu()",
135 tooltip : "change image scale", 135 tooltip : "change image scale",
136 img : "original-size.png" 136 img : "original-size.png"
137 },
138 toggleoptions : {
139 onclick : "morebuttons",
140 tooltip : "more options",
141 img : "options.png"
137 }, 142 },
138 moreoptions : { 143 moreoptions : {
139 onclick : ["morebuttons", "+1"], 144 onclick : ["morebuttons", "+1"],
140 tooltip : "more options", 145 tooltip : "more options",
141 img : "options.png" 146 img : "options.png"
192 // defaults for digilib buttons 197 // defaults for digilib buttons
193 'buttonSettings' : { 198 'buttonSettings' : {
194 'fullscreen' : { 199 'fullscreen' : {
195 // path to button images (must end with a slash) 200 // path to button images (must end with a slash)
196 'imagePath' : 'img/fullscreen/', 201 'imagePath' : 'img/fullscreen/',
197 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","moreoptions"], 202 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","toggleoptions"],
198 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","lessoptions"], 203 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","toggleoptions"],
199 'buttonSets' : ['standardSet', 'specialSet'] 204 'buttonSets' : ['standardSet', 'specialSet']
200 }, 205 },
201 'embedded' : { 206 'embedded' : {
202 'imagePath' : 'img/embedded/16/', 207 'imagePath' : 'img/embedded/16/',
203 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","back","fwd","page","bird","SEP","help","reset","moreoptions"], 208 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","back","fwd","page","bird","SEP","help","reset","toggleoptions"],
204 'specialSet' : ["hmir","vmir","rot","brgt","cont","rgb","quality","size","SEP","lessoptions"], 209 'specialSet' : ["hmir","vmir","rot","brgt","cont","rgb","quality","size","SEP","toggleoptions"],
205 'buttonSets' : ['standardSet', 'specialSet'] 210 'buttonSets' : ['standardSet', 'specialSet']
206 } 211 }
207 }, 212 },
208 // number of visible button groups 213 // number of visible button groups
209 'visibleButtonSets' : 1, 214 'visibleButtonSets' : 1,
433 }, 438 },
434 439
435 // display more (or less) button sets 440 // display more (or less) button sets
436 morebuttons : function (data, more) { 441 morebuttons : function (data, more) {
437 var settings = data.settings; 442 var settings = data.settings;
443 if (more == null) {
444 // toggle more or less
445 var maxbtns = settings.buttonSettings[settings.interactionMode].buttonSets.length;
446 if (settings.visibleButtonSets >= maxbtns) {
447 more = '-1';
448 } else {
449 more = '+1';
450 }
451 }
438 if (more === '-1') { 452 if (more === '-1') {
439 // remove set 453 // remove set
440 var setIdx = settings.visibleButtonSets - 1; 454 var setIdx = settings.visibleButtonSets - 1;
441 if (showButtons(data, false, setIdx, true)) { 455 if (showButtons(data, false, setIdx, true)) {
442 settings.visibleButtonSets--; 456 settings.visibleButtonSets--;