[icinga-checkins] icinga.org: icingaweb2/master: List views: handle clicks on mailto: and http:// links as expected

git at icinga.org git at icinga.org
Fri Jun 3 15:33:22 CEST 2016


Module: icingaweb2
Branch: master
Commit: 4a78fa6a660d5e80d237dfdfac718662cb98d8ba
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=4a78fa6a660d5e80d237dfdfac718662cb98d8ba

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Thu Jun  2 10:43:34 2016 +0200

List views: handle clicks on mailto: and http:// links as expected

refs #11267

---

 public/js/icinga/events.js |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js
index 829ede3..743b7a9 100644
--- a/public/js/icinga/events.js
+++ b/public/js/icinga/events.js
@@ -420,8 +420,8 @@
             var linkTarget = $a.attr('target');
             var $target;
             var formerUrl;
-            var remote = /^(?:[a-z]+:)\/\//;
-            if (href.match(/^(mailto|javascript|data):/)) {
+            if (href.match(/^(?:(?:mailto|javascript|data):|[a-z]+:\/\/)/)) {
+                event.stopPropagation();
                 return true;
             }
 
@@ -439,10 +439,6 @@
                 }
             }
 
-            // Let remote links pass through
-            if  (href.match(remote)) {
-                return true;
-            }
             // window.open is used as return true; didn't work reliable
             if (linkTarget === '_blank' || linkTarget === '_self') {
                 window.open(href, linkTarget);



More information about the icinga-checkins mailing list