Index: modules/overlay/overlay-parent.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v
retrieving revision 1.44
diff -u -r1.44 overlay-parent.js
--- modules/overlay/overlay-parent.js	8 Jun 2010 05:16:29 -0000	1.44
+++ modules/overlay/overlay-parent.js	8 Jun 2010 17:06:24 -0000
@@ -494,29 +494,31 @@
           .attr('href', href);
       }
     }
-    // Open external links in a new window.
-    else if (target.hostname != window.location.hostname) {
-      // Add a target attribute to the clicked link. This is being picked up by
-      // the default action handler.
-      if (!$target.attr('target')) {
-        $target.attr('target', '_new');
-      }
-    }
     // Non-admin links should close the overlay and open in the main window.
     // Only handle them if the overlay is open and the clicked link is inside
     // the overlay iframe, else default action will do fine.
     else if (this.isOpen && target.ownerDocument === this.iframeWindow.document) {
-      // When the link has a destination query parameter and that destination
-      // is an admin link we need to fragmentize it. This will make it reopen
-      // in the overlay.
-      var params = $.deparam.querystring(href);
-      if (params.destination && this.isAdminLink(params.destination)) {
-        var fragmentizedDestination = $.param.fragment(this.getPath(window.location), { overlay: params.destination });
-        $target.attr('href', $.param.querystring(href, { destination: fragmentizedDestination }));
+      // Open external links in a new window.
+      if (target.hostname != window.location.hostname) {
+        // Add a target attribute to the clicked link. This is being picked up by
+        // the default action handler.
+        if (!$target.attr('target')) {
+          $target.attr('target', '_new');
+        }
+      }
+      else {
+        // When the link has a destination query parameter and that destination
+        // is an admin link we need to fragmentize it. This will make it reopen
+        // in the overlay.
+        var params = $.deparam.querystring(href);
+        if (params.destination && this.isAdminLink(params.destination)) {
+          var fragmentizedDestination = $.param.fragment(this.getPath(window.location), { overlay: params.destination });
+          $target.attr('href', $.param.querystring(href, { destination: fragmentizedDestination }));
+        }
+  
+        // Make the link to be opening in the immediate parent of the frame.
+        $target.attr('target', '_parent');
       }
-
-      // Make the link to be opening in the immediate parent of the frame.
-      $target.attr('target', '_parent');
     }
   }
 };
