[fusion-commits] r1725 - in branches/fusion2-mg21: .
layers/MapGuide lib widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Dec 18 17:46:17 EST 2008
Author: chrisclaydon
Date: 2008-12-18 17:46:17 -0500 (Thu, 18 Dec 2008)
New Revision: 1725
Modified:
branches/fusion2-mg21/build.xml
branches/fusion2-mg21/layers/MapGuide/MapGuideViewerApi.js
branches/fusion2-mg21/lib/fusion.js
branches/fusion2-mg21/widgets/Legend.js
branches/fusion2-mg21/widgets/Maptip.js
Log:
Ref #196 - Apply maptip fixes to branch
Modified: branches/fusion2-mg21/build.xml
===================================================================
--- branches/fusion2-mg21/build.xml 2008-12-18 20:58:20 UTC (rev 1724)
+++ branches/fusion2-mg21/build.xml 2008-12-18 22:46:17 UTC (rev 1725)
@@ -17,7 +17,7 @@
from which Ant executes the requested task. This is normally
set to the current working directory.
-->
- <project basedir="." default="compress" name="fusion">
+ <project basedir="." default="deploy" name="fusion">
<!-- ===================== Property Definitions =========================== -->
<!--
@@ -74,9 +74,9 @@
<property environment="env"/>
<property name="app.name" value="fusion"/>
<property name="app.path" value="/${app.name}"/>
- <property name="app.version" value="2.0.x"/>
+ <property name="app.version" value="1.1.x"/>
<property name="build.home" value="${basedir}/build"/>
- <property name="deploy.home" value="."/>
+ <property name="deploy.home" value="${basedir}/../${app.name}"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="docs.home" value="${build.home}/docs"/>
Modified: branches/fusion2-mg21/layers/MapGuide/MapGuideViewerApi.js
===================================================================
--- branches/fusion2-mg21/layers/MapGuide/MapGuideViewerApi.js 2008-12-18 20:58:20 UTC (rev 1724)
+++ branches/fusion2-mg21/layers/MapGuide/MapGuideViewerApi.js 2008-12-18 22:46:17 UTC (rev 1725)
@@ -60,7 +60,13 @@
var digitizer = new Fusion.Tool.Canvas.Point(mapWidget);
digitizer.mouseUp = PointHandlers.prototype.mouseUp;
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);
- digitizer.handler = handler;
+ digitizer.initializeCanvas();
+ var activeWidget = mapWidget.buttonSet.activeButton;
+ mapWidget.buttonSet.setActiveButton(null);
+ digitizer.handler = function() {
+ handler.apply(null, arguments);
+ activeWidget.setActive(true);
+ }
digitizer.activateCanvas();
//add a listener to update the position of the features
@@ -83,7 +89,13 @@
digitizer.mouseDown = LineHandlers.prototype.mouseDown;
digitizer.mouseMove = LineHandlers.prototype.mouseMove;
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);
- digitizer.handler = handler;
+ digitizer.initializeCanvas();
+ var activeWidget = mapWidget.buttonSet.activeButton;
+ mapWidget.buttonSet.setActiveButton(null);
+ digitizer.handler = function() {
+ handler.apply(null, arguments);
+ activeWidget.setActive(true);
+ }
digitizer.activateCanvas();
//add a listener to update the position of the features
@@ -107,7 +119,13 @@
digitizer.mouseMove = MultiPointHandlers.prototype.mouseMove;
digitizer.dblClick = MultiPointHandlers.prototype.dblClick;
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);
- digitizer.handler = handler;
+ digitizer.initializeCanvas();
+ var activeWidget = mapWidget.buttonSet.activeButton;
+ mapWidget.buttonSet.setActiveButton(null);
+ digitizer.handler = function() {
+ handler.apply(null, arguments);
+ activeWidget.setActive(true);
+ }
digitizer.activateCanvas();
//add a listener to update the position of the features
@@ -130,7 +148,13 @@
digitizer.mouseDown = RectangleHandlers.prototype.mouseDown;
digitizer.mouseMove = RectangleHandlers.prototype.mouseMove;
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);
- digitizer.handler = handler;
+ digitizer.initializeCanvas();
+ var activeWidget = mapWidget.buttonSet.activeButton;
+ mapWidget.buttonSet.setActiveButton(null);
+ digitizer.handler = function() {
+ handler.apply(null, arguments);
+ activeWidget.setActive(true);
+ }
digitizer.activateCanvas();
//add a listener to update the position of the features
@@ -154,7 +178,13 @@
digitizer.mouseMove = MultiPointHandlers.prototype.mouseMove;
digitizer.dblClick = MultiPointHandlers.prototype.dblClick;
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);
- digitizer.handler = handler;
+ digitizer.initializeCanvas();
+ var activeWidget = mapWidget.buttonSet.activeButton;
+ mapWidget.buttonSet.setActiveButton(null);
+ digitizer.handler = function() {
+ handler.apply(null, arguments);
+ activeWidget.setActive(true);
+ }
digitizer.activateCanvas();
//add a listener to update the position of the features
Modified: branches/fusion2-mg21/lib/fusion.js
===================================================================
--- branches/fusion2-mg21/lib/fusion.js 2008-12-18 20:58:20 UTC (rev 1724)
+++ branches/fusion2-mg21/lib/fusion.js 2008-12-18 22:46:17 UTC (rev 1725)
@@ -49,7 +49,9 @@
destination[property] = parent[property];
}
}
- parent.initialize.apply(destination, args);
+ if (parent.initialize) {
+ parent.initialize.apply(destination, args);
+ }
};
(function() {
Modified: branches/fusion2-mg21/widgets/Legend.js
===================================================================
--- branches/fusion2-mg21/widgets/Legend.js 2008-12-18 20:58:20 UTC (rev 1724)
+++ branches/fusion2-mg21/widgets/Legend.js 2008-12-18 22:46:17 UTC (rev 1725)
@@ -332,6 +332,16 @@
if (item instanceof Jx.TreeFolder) {
this.recurseTree(op, item);
item[op]();
+ if (item.domObj) {
+ var p = $(item.domObj).getPrevious();
+ if (p) {
+ item.domObj.dispose();
+ $(item.domObj).inject(p, 'before');
+ } else {
+ p = $(item.domObj).getParent();
+ $(item.domObj).inject(p, 'top');
+ }
+ }
}
}
},
Modified: branches/fusion2-mg21/widgets/Maptip.js
===================================================================
--- branches/fusion2-mg21/widgets/Maptip.js 2008-12-18 20:58:20 UTC (rev 1724)
+++ branches/fusion2-mg21/widgets/Maptip.js 2008-12-18 22:46:17 UTC (rev 1725)
@@ -56,7 +56,7 @@
aLayers: null,
bOverTip: false,
sWinFeatures: 'menubar=no,location=no,resizable=no,status=no',
- offset: new OpenLayers.Pixel(2,2),
+ offset: new OpenLayers.Pixel(2,20),
initializeWidget: function(widgetTag) {
var json = widgetTag.extension;
@@ -100,6 +100,8 @@
document.getElementsByTagName('BODY')[0].appendChild(this.domObj);
this.getMap().observeEvent('mousemove', OpenLayers.Function.bind(this.mouseMove, this));
+ this.getMap().observeEvent('mousedown', OpenLayers.Function.bind(this.mouseDown, this));
+ this.getMap().observeEvent('mouseup', OpenLayers.Function.bind(this.mouseUp, this));
this.getMap().observeEvent('mouseout', OpenLayers.Function.bind(this.mouseOut, this));
},
@@ -117,7 +119,7 @@
mouseMove: function(e) {
//console.log('map tip mouseMove');
- if (this.bOverTip) {
+ if (this.bOverTip || this.mouseIsDown) {
return;
}
@@ -136,6 +138,15 @@
//Event.stop(e);
},
+ mouseDown: function() {
+ this.mouseIsDown = true;
+ this._hide();
+ },
+
+ mouseUp: function() {
+ this.mouseIsDown = false;
+ },
+
showMaptip: function(r) {
//console.log('showMaptip');
var map = this.getMap();
@@ -185,6 +196,10 @@
},
_display: function(tooltip) {
+ if (this.mouseIsDown) {
+ return;
+ }
+
//console.log('maptip _display');
this.domObj.innerHTML = ' ';
var contentDiv = document.createElement('div');
More information about the fusion-commits
mailing list