changeset 975:fed2f0ba586c

scale mode select reflects current mode.
author robcast
date Thu, 26 Jan 2012 15:36:45 +0100
parents 678313a989a9
children c01876d65bb8
files webapp/src/main/webapp/jquery/jquery.digilib.buttons.js
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js	Thu Jan 26 15:06:00 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js	Thu Jan 26 15:36:45 2012 +0100
@@ -256,12 +256,21 @@
             // shows ScaleModeSelector
             showScaleModeSelector : function (data) {
                 var $elem = data.$elem;
-                var settings = data.settings;
                 var $div = $("#scalemode");
                 if ($div.is(":visible")) {
                     $div.fadeOut();
                     return;
                     }
+                // select current mode
+                var mode = data.scaleMode;
+                $div.find('option').each(function () {
+                	$this = $(this);
+                	if ($this.attr('name') == mode) {
+                		$this.prop('selected', true);
+                	} else {
+                		$this.prop('selected', false);
+                	}
+                });
                 var $button = $elem.find('div.button-scale');
                 var buttonRect = geom.rectangle($button);
                 var divRect = geom.rectangle($div);