[fusion-commits] r2674 - in trunk: text widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Fri Mar 22 11:11:52 PDT 2013


Author: jng
Date: 2013-03-22 11:11:51 -0700 (Fri, 22 Mar 2013)
New Revision: 2674

Modified:
   trunk/text/en.json
   trunk/widgets/Measure.js
Log:
#550: Add a "stop" link to the measure digitization message area to allow a user to stop digitization from that link. This is UX workaround required for the Aqua template which has a problem of a "floating" Task Pane that offers no hooks when its window is "closed"

Modified: trunk/text/en.json
===================================================================
--- trunk/text/en.json	2013-03-22 17:38:59 UTC (rev 2673)
+++ trunk/text/en.json	2013-03-22 18:11:51 UTC (rev 2674)
@@ -21,6 +21,7 @@
 'selectionInfo': '${features} feature(s) selected on ${layers} layer(s)',
 'attribute': 'Attribute',
 'value': 'Value',
+'stop': 'Stop',
 'taskHome': 'return to the task pane home',
 'prevTask': 'go to previous task executed',
 'nextTask': 'go to next task executed',

Modified: trunk/widgets/Measure.js
===================================================================
--- trunk/widgets/Measure.js	2013-03-22 17:38:59 UTC (rev 2673)
+++ trunk/widgets/Measure.js	2013-03-22 18:11:51 UTC (rev 2674)
@@ -455,8 +455,14 @@
     
     startMeasurement: function() {
         this.control.activate();
-        this.getMap().message.info(OpenLayers.i18n("measureInProgress"));
-        this.resetMeasure();
+        //We add a stub "stop" link to the MapMessage, then wire it up to stopMeasurement() by fetching the
+        //anchor element through its DOM
+        var msg = this.getMap().message;
+        msg.info(OpenLayers.i18n("measureInProgress") + " <a id='measureMsgDismiss' href='javascript:void(0)'>" + OpenLayers.i18n("stop") + "</a>");
+        var link = msg.container.ownerDocument.getElementById("measureMsgDismiss");
+        //Wire the anchor click
+        link.onclick = OpenLayers.Function.bind(this.stopMeasurement, this);
+        
         OpenLayers.Event.observe(document,"keypress",this.keyHandler);
         this.getMap().supressContextMenu(true);
         this.updateButtonStates();



More information about the fusion-commits mailing list