changeset 962:e9e50df87c9a

IE cares for commas, again
author hertzhaft
date Wed, 25 Jan 2012 16:12:33 +0100
parents f197e7760154
children 548988d9fad5
files webapp/src/main/webapp/jquery/jquery.digilib.buttons.js webapp/src/main/webapp/jquery/jquery.digilib.js
diffstat 2 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js	Tue Jan 24 21:12:13 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js	Wed Jan 25 16:12:33 2012 +0100
@@ -187,7 +187,7 @@
                     }
             },
             // number of visible button groups
-            'visibleButtonSets' : 1,
+            'visibleButtonSets' : 1
     };
 
     var actions = {
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Tue Jan 24 21:12:13 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Wed Jan 25 16:12:33 2012 +0100
@@ -243,6 +243,8 @@
                 setupScalerDiv(data);
                 // about window creation - TODO: could be deferred? restrict to only one item?
                 setupAboutDiv(data);
+                // scale mode menu creation - TODO: could be deferred?
+                setupScaleModeDiv(data);
                 // arrow overlays for moving zoomed detail
                 setupZoomArrows(data);
                 // send setup event
@@ -553,7 +555,6 @@
                 redisplay(data);
             }
         }
-
     // end of actions
     };
 
@@ -1155,6 +1156,27 @@
             });
     };
 
+    /** creates HTML structure for the scale mode menu
+     * 
+     */
+    var setupScaleModeDiv = function (data) {
+        var $elem = data.$elem;
+        var settings = data.settings;
+        var $scaleModeDiv = $('<div class="scalemode" style="display:none"/>');
+        var $scaleModeSelect = $('<select class="scalemode" />');
+        var $scaleModeOptScreen = $('<option name="fit">fit to screen</option>');
+        var $scaleModeOptPixel = $('<option name="pixel">pixel by pixel</option>');
+        var $scaleModeOptOrig = $('<option name="original">original size</option>');
+        $elem.append($scaleModeDiv);
+        $scaleModeDiv.append($scaleModeSelect);
+        $scaleModeSelect.append($scaleModeOptScreen);
+        $scaleModeSelect.append($scaleModeOptPixel);
+        $scaleModeSelect.append($scaleModeOptOrig);
+        $scaleModeSelect.on('change.digilib', function () {
+            actions['setScaleMode'](data, false);
+            });
+    };
+
     /** shows some window e.g. 'about' (toggle visibility if show is null)
      * 
      */