Mercurial > hg > digilib-old
changeset 637:d904c0c74c15 jquery
small fixes
author | robcast |
---|---|
date | Tue, 18 Jan 2011 22:50:03 +0100 |
parents | 7049579a0097 |
children | 830bf803d9f0 |
files | client/digitallibrary/jquery/jquery.digilib.js |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js Tue Jan 18 21:30:03 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Tue Jan 18 22:50:03 2011 +0100 @@ -164,6 +164,7 @@ 'wx' : 0.0, 'wy' : 0.0, 'ws' : 1.0, + 'pn' : 1, // mode of operation. // fullscreen: takes parameters from page URL, keeps state in page URL // embedded: takes parameters from Javascript options, keeps state inside object @@ -288,16 +289,18 @@ // sets a key to a value (relative values with +/- if relative=true) var setNumValue = function(settings, key, value) { - // TODO: type and error checking - if (settings[key] == null) return null; var sign = value.substring(0,1); if (sign === '+' || sign === '-') { - settings[key] = parseFloat(settings[key]) + parseFloat(value); + if (settings[key] == null) { + // this doesn't make much sense but still... + settings[key] = 0; + } + settings[key] = parseFloat(settings[key]) + parseFloat(value); } else { settings[key] = value; - } + } return settings[key]; - }; + }; // returns parameters from page url var parseQueryParams = function() { @@ -520,7 +523,7 @@ } })()); $img.attr('src', settings.buttonsImagePath + actionSettings.img); - }; + } } return $buttonsDiv; }; @@ -638,7 +641,7 @@ // auxiliary function to crop senseless precision var cropFloat = function (x) { - return parseInt(10000 * x) / 10000; + return parseInt(10000 * x, 10) / 10000; }; // hook plugin into jquery