* When using frontend editing with pop-up window the save-and-view button will not...
authorKasper Skårhøj <kasper@typo3.org>
Wed, 27 Apr 2005 10:09:55 +0000 (10:09 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Wed, 27 Apr 2005 10:09:55 +0000 (10:09 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@671 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
typo3/alt_doc.php

index 0bd7fde..fe5f20d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-04-27  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * When using frontend editing with pop-up window the save-and-view button will not change focus of the windows but keep the editing window on top while reloading the page for preview behind. (Works in any case editing happens in a pop-up window)
+
 2005-04-21 => 04-26  Kasper Skårhøj,,,  <kasper@typo3.com>
 
        * Added a runaway brake to t3lib_div::expandList(): Ranges are limited to 1000 values per range.
index cccc26c..c8ecbd9 100755 (executable)
@@ -2177,9 +2177,10 @@ class t3lib_BEfunc       {
         * @param       string          $anchor is optional anchor to the URL
         * @param       string          $altUrl is an alternative URL which - if set - will make all other parameters ignored: The function will just return the window.open command wrapped around this URL!
         * @param       string          Additional GET variables.
+        * @param       boolean         If true, then the preview window will gain the focus.
         * @return      string
         */
-       function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='',$addGetVars='')        {
+       function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='',$addGetVars='',$switchFocus=TRUE)      {
                if ($altUrl)    {
                        $url = $altUrl;
                } else {
@@ -2193,7 +2194,8 @@ class t3lib_BEfunc        {
                        $url = $preUrl.'/index.php?id='.$id.$addGetVars.$anchor;
                }
 
-               return "previewWin=window.open('".$url."','newTypo3FrontendWindow','status=1,menubar=1,resizable=1,location=1,scrollbars=1,toolbar=1');previewWin.focus();";
+               return "previewWin=window.open('".$url."','newTypo3FrontendWindow','status=1,menubar=1,resizable=1,location=1,scrollbars=1,toolbar=1');".
+                               ($switchFocus ? 'previewWin.focus();' : '');
        }
 
        /**
index aac0ff7..7d56d58 100755 (executable)
@@ -414,7 +414,13 @@ class SC_alt_doc {
                                }
                                return false;
                        }
-               '.(isset($_POST['_savedokview_x']) && $this->popViewId ? t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl,$this->popViewId_addParams) : '')
+               '.(isset($_POST['_savedokview_x']) && $this->popViewId ?
+                       'if (window.opener) { '.
+                               t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl,$this->popViewId_addParams,FALSE).
+                               ' } else { '.
+                               t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl,$this->popViewId_addParams).
+                               ' } '
+                       : '')
                ).$this->doc->getDynTabMenuJScode();
 
                        // Setting up the context sensitive menu: