ensure the map is initialized and visible if 'find in maps' is clicked.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 5 Dec 2009 22:56:37 +0000 (17:56 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 5 Dec 2009 22:56:37 +0000 (17:56 -0500)
kronolith/js/kronolith.js

index e97e3d2..e1255ce 100644 (file)
@@ -2859,6 +2859,7 @@ KronolithCore = {
                 return;
 
             case 'kronolithEventGeo':
+                this.ensureMap();
                 this.geocode($F('kronolithEventLocation'));
                 e.stop();
                 return;
@@ -3623,6 +3624,18 @@ KronolithCore = {
        if (center) {
            this.map.setCenter(ll);
        }
+   },
+
+   ensureMap: function()
+   {
+       if (!this.mapInitialized) {
+           this.initializeMap();
+       }
+       var dialog = $('kronolithEventForm')
+       dialog.select('.kronolithTabsOption').invoke('hide');
+       dialog.select('.tabset li').invoke('removeClassName', 'activeTab');
+       $('kronolithEventTabMap').show();
+       $('kronolithEventLinkMap').parentNode.addClassName('activeTab');
    }
 
 };