diff --git a/app/assets/javascripts/sitewide/tooltip_helper.js b/app/assets/javascripts/sitewide/tooltip_helper.js index 37ed46a9e..55fa035e2 100644 --- a/app/assets/javascripts/sitewide/tooltip_helper.js +++ b/app/assets/javascripts/sitewide/tooltip_helper.js @@ -2,10 +2,11 @@ 'use strict'; $.initTooltips = function() { - if ($(document.body).data("tooltips-enabled") === true || $(document.body).data("tooltips-enabled") == null) { - var popoversArray = []; - var leaveTimeout; - var enterTimeout; + var popoversArray = []; + var leaveTimeout; + var enterTimeout; + + if ($(document.body).data('tooltips-enabled') === true || $(document.body).data('tooltips-enabled') == null) { $('.tooltip_open').remove(); // Destroy all (if any) old open popovers $('.help_tooltips').each(function(i, obj) { var popoverObject = obj; @@ -14,62 +15,73 @@ $('.help_tooltips').each(function(i, obj) { var link = $(obj).data('tooltiplink'); var textData = $(obj).data('tooltipcontent'); + var customStyle = $(obj).data('tooltipstyle'); - $(obj).popover({ - html: true, - container: 'body', - placement: 'auto right', - trigger: 'manual', - content: 'popovers will not display if empty', - template: '' - }).off("shown.bs.popover").on("shown.bs.popover", function() { - // hide all other popovers - popoversArray.forEach(function(arrayItem) { - if (obj !== arrayItem) { - $(arrayItem).popover("hide"); - } - }); - }).off("mouseleave").on("mouseleave", function( ) { - clearTimeout(enterTimeout); - leaveTimeout = setTimeout(function() { - if (!$(".tooltip_" + i + "_window:hover").length > 0) { - $(obj).popover("hide"); - } - }, 100); - }).off("mouseenter").on("mouseenter", function() { - clearTimeout(leaveTimeout); - enterTimeout = setTimeout(function() { - if ($(obj).hover().length > 0) { - $(obj).popover("show"); - $(".tooltip_" + i + "_window").removeClass("tooltip-enter"); - var top = $(obj).offset().top; - $('.tooltip_' + i + '_window').css({ - top: (top) + 'px' - }); - $(".tooltip_" + i + "_window").off("mouseleave").on("mouseleave", function() { - $(".tooltip_" + i + "_window").removeClass("tooltip-enter"); + $(obj) + .popover({ + html: true, + container: 'body', + placement: 'auto right', + trigger: 'manual', + content: 'popovers will not display if empty', + template: + '
' + + '
' + textData + '
' + + '


' + + '' + + '
' + }) + .off('shown.bs.popover') + .on('shown.bs.popover', function() { + // hide all other popovers + popoversArray.forEach(function(arrayItem) { + if (obj !== arrayItem) { + $(arrayItem).popover('hide'); + } + }); + }) + .off('mouseleave') + .on('mouseleave', function() { + clearTimeout(enterTimeout); + leaveTimeout = setTimeout(function() { + if (!$('.tooltip_' + i + '_window:hover').length > 0) { $(obj).popover('hide'); - }); - $(".tooltip_" + i + "_window").off("mouseenter").on("mouseenter", function() { - $(".tooltip_" + i + "_window").addClass("tooltip-enter"); - }); - } - }, 1000); - }); - }) - } - } + } + }, 100); + }) + .off('mouseenter') + .on('mouseenter', function() { + clearTimeout(leaveTimeout); + enterTimeout = setTimeout(function() { + var top; - $(document).ready(function() { + if ($(obj).hover().length > 0) { + $(obj).popover('show'); + $('.tooltip_' + i + '_window').removeClass('tooltip-enter'); + top = $(obj).offset().top; + $('.tooltip_' + i + '_window').css({ + top: (top) + 'px' + }); + $('.tooltip_' + i + '_window').off('mouseleave').on('mouseleave', function() { + $('.tooltip_' + i + '_window').removeClass('tooltip-enter'); + $(obj).popover('hide'); + }); + $('.tooltip_' + i + '_window').off('mouseenter').on('mouseenter', function() { + $('.tooltip_' + i + '_window').addClass('tooltip-enter'); + }); + } + }, 1000); + }); + }); + } + }; + + $(document).on('turbolinks:load', function() { $.initTooltips(); }); - }()); diff --git a/app/assets/stylesheets/themes/main_navigation.scss b/app/assets/stylesheets/themes/main_navigation.scss index 487e8a44c..0aa85f328 100644 --- a/app/assets/stylesheets/themes/main_navigation.scss +++ b/app/assets/stylesheets/themes/main_navigation.scss @@ -175,7 +175,7 @@ } } -.notification-settings-container { +.preferences-settings-container { margin-bottom: 50px; margin-top: 50px; diff --git a/app/views/canvas/_tags.html.erb b/app/views/canvas/_tags.html.erb index 7895887f6..d87b3258c 100644 --- a/app/views/canvas/_tags.html.erb +++ b/app/views/canvas/_tags.html.erb @@ -1,10 +1,12 @@ -
+
<% tags2 = my_module.tags[0..3] %> <% tags2.each do |tag| %>
help_tooltips" - data-tooltiplink="<%= I18n.t('tooltips.link.task.color_tag') %>" - data-tooltipcontent="<%= I18n.t('tooltips.text.task.color_tag') %>" + class="<%= "last" if tag == tags2[-1] %>" title="<%= tag.name %>">
diff --git a/app/views/shared/_invite_users_modal.html.erb b/app/views/shared/_invite_users_modal.html.erb index 89b7b61b4..4ef8ed571 100644 --- a/app/views/shared/_invite_users_modal.html.erb +++ b/app/views/shared/_invite_users_modal.html.erb @@ -111,12 +111,21 @@ invite_to_team = type.in?(%w(invite_to_team invite_to_team_with_role)) -
-