mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-11 09:26:37 +08:00
Testing out new popover
This commit is contained in:
parent
9fd02e71c9
commit
d2373980d4
3 changed files with 22 additions and 13 deletions
|
@ -2,25 +2,29 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var hover_timer
|
|
||||||
var text_to_display = $('.popover_v2').data('content')
|
|
||||||
$('.popover_v2').popover({
|
$('.popover_v2').popover({
|
||||||
html: true,
|
html: true,
|
||||||
container: 'body',
|
container: 'body',
|
||||||
placement: 'auto right',
|
placement: 'auto right',
|
||||||
trigger: 'manual',
|
trigger: 'manual',
|
||||||
template: '<div class="popover" role="tooltip"><div class="popover-body">'+text_to_display+'</div></div>',
|
template: '<div class="popover popover_v2_window" role="tooltip"><div class="popover-body">' +
|
||||||
|
$('.popover_v2').data('content') +
|
||||||
|
'</div><div class="popover-footer" style="position:absolute;bottom:5px;right:5px;">' +
|
||||||
|
'<a class="ax_default link_button" href="https://www.google.si"><i class="fas fa-external-link-alt">nekaj</i></a></div></div>'
|
||||||
}).on("mouseenter", function () {
|
}).on("mouseenter", function () {
|
||||||
hover_timer = setTimeout(function () {
|
|
||||||
$('.popover_v2').popover("show")
|
|
||||||
}, 1000);
|
|
||||||
$('body').find(".popover").on("mouseleave", function () {
|
|
||||||
$('.popover_v2').popover('hide');
|
|
||||||
});
|
|
||||||
}).on("mouseleave", function () {
|
|
||||||
clearTimeout(hover_timer)
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (!$(".popover:hover").length) {
|
$('.popover_v2').popover("show")
|
||||||
|
var top = $('.popover_v2').offset().top;
|
||||||
|
$('.popover_v2_window').css({
|
||||||
|
top: (top) + 'px'
|
||||||
|
});
|
||||||
|
$(".popover_v2_window").on("mouseleave", function () {
|
||||||
|
$('.popover_v2').popover('hide');
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}).on("mouseleave", function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
if (!$(".popover_v2_window:hover").length) {
|
||||||
$('.popover_v2').popover("hide")
|
$('.popover_v2').popover("hide")
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
name="q"
|
name="q"
|
||||||
placeholder="<%= t('nav.search') %>" />
|
placeholder="<%= t('nav.search') %>" />
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default" type="submit"><%=t 'nav.search_button' %></button>
|
<button class="btn btn-default popover_v2" data-content="<%= I18n.t('test.popover.test') %>" type="submit"><%=t 'nav.search_button' %></button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1992,3 +1992,8 @@ en:
|
||||||
password_confirmation_not_match: "doesn't match"
|
password_confirmation_not_match: "doesn't match"
|
||||||
invite_users:
|
invite_users:
|
||||||
permission_error: "You don't have permission to invite additional users to this team. Contact its administrator/s."
|
permission_error: "You don't have permission to invite additional users to this team. Contact its administrator/s."
|
||||||
|
|
||||||
|
test:
|
||||||
|
popover:
|
||||||
|
test: "You don't have permission to invite additional users to this team -- just kidding, test text"
|
||||||
|
learn_more: "https://support.scinote.net/hc/en-us/articles/115001787811-What-are-the-permissions-for-each-user-role-"
|
||||||
|
|
Loading…
Reference in a new issue