mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
[frio] Add .add-to-modal delegated event on anchors
- Improve hovercard button accessibility
This commit is contained in:
parent
dc2f1d6bd3
commit
9ac7d20df3
2 changed files with 17 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue