]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/js/modal.js
Merge pull request #7459 from annando/notice
[friendica.git] / view / theme / frio / js / modal.js
index ab263bc2ab76cb19082e7990b0d710fb56096fa4..9bca427779fcbc057e05aa5b81e4c84ea863d74e 100644 (file)
@@ -93,6 +93,21 @@ $(document).ready(function(){
                input.val(img);
                
        });
+
+       // Generic delegated event to open an anchor URL in a modal.
+       // Used in the hovercard.
+       document.getElementsByTagName('body')[0].addEventListener('click', function(e) {
+               var target = e.target;
+               while (target) {
+                       if (target.matches && target.matches('a.add-to-modal')) {
+                               addToModal(target.href);
+                               e.preventDefault();
+                               return false;
+                       }
+
+                       target = target.parentNode || null;
+               }
+       });
 });
 
 // Overwrite Dialog.show from main js to load the filebrowser into a bs modal.