Announcement

Collapse
No announcement yet.

Closing Extended Information Windows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Closing Extended Information Windows

    Has anyone noticed that, if a visitor to a site fails to explitly close any Extended Informaton Windows they ahve opened those windows will not be closed automatically when the visitor closes the ,main site window?

    Instead, on closing the main window the visitor may be left with a number of Extended Information Windows littered about their desktop which they then have to go round closing individually to tidy things up.

    Ideally, I think Sellerdeck shold automatically close all open Extended information Windows and any other pop ups that are still open when the main window is closed.

    But does anyone know of a fix for this?

    #2
    Here's (from a Google search - https://www.py4u.net/discuss/346233 answer #4) a way that makes popup windows automatically expire if the parent window no longer exists.
    Put it into your Extended Info popup layout just before the </head> tag:
    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsNotPreviewMode%22%20%2f%3e">
    	<script type="text/javascript">
    		function CloseOnParentClose() {
    			if (typeof window.opener != 'undefined' && window.opener != null) {
    				if (window.opener.closed) {
    					window.close();
    				}
    			}
    			else {
    				window.close();
    			}
    		}
    		$(window).ready(function () {
    			 setInterval(CloseOnParentClose, 1000);
    		});
    	</script>
    </actinic:block>
    Last edited by NormanRouxel; 22-Dec-2021, 05:51 PM. Reason: Updated to add a BlockIf so it doesn't interfere with Preview pages.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Many thanks for your posting.

      That was very helpful.

      I tried it out and it seems to work well - but there is one odd side effect.

      With that code in place, whenever I navigate to the Extended information content in Sellerdeck it gives a pop up message saying:

      "The website you are viewing is trying to close the pop-up window.
      Do you want to close this window?"

      I attach a screen shot.

      It looks as if the code executes within Sellerdeck itself.

      Any thoughts on this would be welcome!
      Attached Files

      Comment


        #4
        You could try wrapping the code in a IsNotPreviewMode blockif. That might stop it.
        -----------------------------------------

        First Tackle - Fly Fishing and Game Angling

        -----------------------------------------

        Comment


          #5
          Many thanks for your posting.

          I tried this:

          <script type="text/javascript">
          function CloseOnParentClose() {
          if (typeof window.opener != 'undefined' && window.opener != null) {
          if (window.opener.closed) {
          window.close();
          }
          }
          else {
          window.close();
          }
          }
          if IsNotPreviewMode {
          $(window).ready(function () {
          setInterval(CloseOnParentClose, 1000);
          });
          }
          </script>

          That got rid of the problem in Sellerdeck; but it also stopped the Extended Info window from closing at all.

          The following bits of code also stopped it closing the pop up window when exiting the main window:

          blockif IsNotPreviewMode>
          <script type="text/javascript">
          function CloseOnParentClose() {
          if (typeof window.opener != 'undefined' && window.opener != null) {
          if (window.opener.closed) {
          window.close();
          }
          }
          else {
          window.close();
          }
          }
          $(window).ready(function () {
          setInterval(CloseOnParentClose, 1000);
          });
          </script>
          /block

          And this code also stopped the pop up closing:

          <actinic:block if IsNotPreviewMode>
          <script type="text/javascript">
          function CloseOnParentClose() {
          if (typeof window.opener != 'undefined' && window.opener != null) {
          if (window.opener.closed) {
          window.close();
          }
          }
          else {
          window.close();
          }
          }
          $(window).ready(function () {
          setInterval(CloseOnParentClose, 1000);
          });
          </script>
          </actinic:block>

          Any suggestions would, of course, be gratefully appreciated.

          Comment


            #6
            Mike's suggestion was spot on but you're not using the BlockIf correctly.
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsNotPreviewMode%22%20%2f%3e">
            	<script type="text/javascript">
            		function CloseOnParentClose() {
            			if (typeof window.opener != 'undefined' && window.opener != null) {
            				if (window.opener.closed) {
            					window.close();
            				}
            			}
            			else {
            				window.close();
            			}
            		}
            		$(window).ready(function () {
            			 setInterval(CloseOnParentClose, 1000);
            		});
            	</script>
            </actinic:block>
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Many thanks for your posting.

              That worked perfectly!

              The code now closes all pop ups when the main window is exited; and the Sellerdeck software no longer misbehaves.

              Between you, you appear to be unbeatable!

              Comment


                #8
                True. Although it's mostly Norman that deserves the credit.
                -----------------------------------------

                First Tackle - Fly Fishing and Game Angling

                -----------------------------------------

                Comment


                  #9
                  Not me. I just googled for a solution and chose one from William Trout on stackoverflow.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    Either way, it's such a useful addition to Sellerdeck that the absence of it almost looks like a bug - I can't think of any users who would be happy to see Extended Information pop-ups still littering their desktop long after they've left the site!

                    Comment

                    Working...
                    X