From e962fb6f47e8992bf69f011a9be1e5b9e83251fe Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 2 Dec 2012 20:07:01 +0100 Subject: [PATCH] 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. --- apps/companyfront/modules/ad/templates/_form.php | 33 +++++++++++++--------- .../modules/admap/templates/admapSuccess.php | 6 +++- .../modules/admap/templates/officemapSuccess.php | 7 ++++- .../modules/office/templates/_formCustomOffice.php | 31 ++++++++++++-------- 4 files changed, 49 insertions(+), 28 deletions(-) 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 @@