From: Gustavo Martin Morcuende Date: Sun, 2 Dec 2012 19:07:01 +0000 (+0100) Subject: Google maps window: open once per click X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=e962fb6f47e8992bf69f011a9be1e5b9e83251fe;p=mobi%2F.git Google maps window: open once per click Bonus: now you can edit directly the coordinates without opening an annoying new window every time you click in the GPS coodinates box. After closing the goolge maps window it can be opened agais just clicking again in the GPS coordinates box. --- diff --git a/apps/companyfront/modules/ad/templates/_form.php b/apps/companyfront/modules/ad/templates/_form.php index e8f0041..789be45 100644 --- a/apps/companyfront/modules/ad/templates/_form.php +++ b/apps/companyfront/modules/ad/templates/_form.php @@ -2,30 +2,35 @@ diff --git a/apps/companyfront/modules/admap/templates/officemapSuccess.php b/apps/companyfront/modules/admap/templates/officemapSuccess.php index 4f23690..a8737a6 100644 --- a/apps/companyfront/modules/admap/templates/officemapSuccess.php +++ b/apps/companyfront/modules/admap/templates/officemapSuccess.php @@ -62,9 +62,14 @@ document.body.appendChild(script); } + function taskOnExit() { + self.opener.alreadyOpened = false; + } + window.onload = loadScript; - google.maps.event.addDomListener(window, 'load', initialize); + window.onbeforeunload = taskOnExit; + diff --git a/apps/companyfront/modules/office/templates/_formCustomOffice.php b/apps/companyfront/modules/office/templates/_formCustomOffice.php index f2f5054..b5793b3 100644 --- a/apps/companyfront/modules/office/templates/_formCustomOffice.php +++ b/apps/companyfront/modules/office/templates/_formCustomOffice.php @@ -34,27 +34,34 @@