Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update popover() method to prevent its untimely dismissal #227

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/tree-edam-stand-alone.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function interactive_edam_browser(){
});
}
}
$('#details-'+identifier+' .'+id_b+' [data-toggle="popover"]').popover();
$('#details-'+identifier+' .'+id_b+' [data-toggle="popover"]').popover({trigger: 'hover focus', container: ':scope [data-toggle="popover"]'});
});
}
var caller_s=biosphere_api().get_for(current_branch, __my_interactive_tree.textAccessor()(d), uri, d);
Expand All @@ -441,7 +441,7 @@ function interactive_edam_browser(){
to_biosphere_href(c[0],caller_s.get_url(),data[0]) + ' by appliances, ' +
to_biosphere_href(c[1],caller_s.get_url(),data[1]) + ' by tools.' +
'</span>').appendTo(elt);
$('#details-'+identifier+' .'+id_s+' [data-toggle="popover"]').popover();
$('#details-'+identifier+' .'+id_s+' [data-toggle="popover"]').popover({trigger: 'hover focus', container: ":scope"});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triggering also on focus is a good idea, but should be done when the popover is written (in once place) instead on when it is instanciated (4 times). The part was not readable at the time, I improved it and you can see [here](https://github.com/edamontology/edam-browser/blob/main/js/tree-edam-stand-alone.js#L256-L261 that you can change properties for all link with popover

});
}
var caller_w=bioweb_api().get_for(current_branch, __my_interactive_tree.textAccessor()(d), uri, d);
Expand All @@ -451,7 +451,7 @@ function interactive_edam_browser(){
var elt=$('#details-'+identifier+' .'+id_w);
elt.empty();
$(to_bioweb_href(c,caller_w.get_url(),data)).appendTo(elt);
$('#details-'+identifier+' .'+id_w+' [data-toggle="popover"]').popover();
$('#details-'+identifier+' .'+id_w+' [data-toggle="popover"]').popover({trigger: 'hover focus', container: ":scope"});
});
}
var caller_t=tess_api().get_for(current_branch, __my_interactive_tree.textAccessor()(d), uri, d);
Expand All @@ -461,7 +461,7 @@ function interactive_edam_browser(){
var elt=$('#details-'+identifier+' .'+id_t);
elt.empty();
$(to_tess_href(c,caller_t.get_url(),data)).appendTo(elt);
$('#details-'+identifier+' .'+id_t+' [data-toggle="popover"]').popover();
$('#details-'+identifier+' .'+id_t+' [data-toggle="popover"]').popover({trigger: 'hover focus', container: ":scope"});
});
}
if(uri.startsWith("http://edamontology.org/")){
Expand Down