diff --git a/app/assets/javascripts/sitewide/popover_helper.js b/app/assets/javascripts/sitewide/popover_helper.js
index ce09be412..c7e2601d3 100644
--- a/app/assets/javascripts/sitewide/popover_helper.js
+++ b/app/assets/javascripts/sitewide/popover_helper.js
@@ -3,10 +3,18 @@
$(document).ready(function() {
//if( user has popovers turned on from settings ){
+ var popovers_array = [];
+
+ $('.popover_v2').each(function(i,obj) {
+ var popover_object = obj;
+ popovers_array.push(popover_object);
+ });
$('.popover_v2').each(function(i,obj) {
var link = $(obj).data('popoverlink')
- var text_data = $(obj).data('content')
+ var text_data = $(obj).data('popovercontent')
+ /* Testing
var needed_attribute = $(obj).attr("data-content");
+
if (typeof needed_attribute !== typeof undefined && needed_attribute !== false && needed_attribute !== "") {
// Do nothing, will negate the above logic later
}else{
@@ -14,15 +22,22 @@
// without a data-content attribute in its parent element, the popover will NEVER render
// it assumes it is empty because I fill data trough the template.
}
+ */
$(obj).popover({
html: true,
container: 'body',
placement: 'auto right',
trigger: 'manual',
- template: '
'
+ content: 'should never be empty',
+ template: '' +
+ '
' + text_data + '
' +
+ '
' +
+ '' +
+ '
'
}).on("mouseenter", function () {
setTimeout(function () {
if ($(obj).hover().length) {
@@ -32,11 +47,11 @@
top: (top) + 'px'
});
$(".popover_"+i+"_window").on("mouseleave", function () {
+ $(obj).popover('hide');
$(".popover_"+i+"_window").css("background-color","#F0F0F0");
- $(obj).popover('hide');
});
$(".popover_"+i+"_window").on("mouseenter", function () {
- $(".popover_"+i+"_window").css("background-color","#DADADA");
+ $(".popover_"+i+"_window").css("background-color","#DADADA");
});
}
}, 1000);
@@ -46,8 +61,13 @@
$(obj).popover("hide")
}
}, 500);
- }).on('shown', function(){
+ }).on("shown.bs.popover", function(){
// hide all other popovers
+ popovers_array.forEach(function (arrayItem) {
+ if(obj !== arrayItem){
+ $(arrayItem).popover("hide")
+ }
+ });
});
})
//}
diff --git a/app/datatables/protocols_datatable.rb b/app/datatables/protocols_datatable.rb
index 89818b11a..d95419f10 100644
--- a/app/datatables/protocols_datatable.rb
+++ b/app/datatables/protocols_datatable.rb
@@ -199,8 +199,12 @@ class ProtocolsDatatable < CustomDatatable
end
def modules_html(record)
- "" +
+ "" +
"#{record.nr_of_linked_children}" +
""
end
diff --git a/app/views/canvas/_edit.html.erb b/app/views/canvas/_edit.html.erb
index 1a4e58621..13a983720 100644
--- a/app/views/canvas/_edit.html.erb
+++ b/app/views/canvas/_edit.html.erb
@@ -10,12 +10,12 @@
>
<%= bootstrap_form_tag url: canvas_experiment_url, method: "post" do |f| %>
<% if can_manage_experiment?(@experiment) %>
- <%=link_to "", type: "button", class: "btn btn-primary", id: "canvas-new-module" do %>
-
+ <%=link_to "", type: "button", class: "btn btn-primary popover_v2", id: "canvas-new-module" do %>
+
<%= t("experiments.canvas.edit.new_module") %>
-
+
<%= t("experiments.canvas.edit.new_module_hover") %>
<%= t("experiments.canvas.edit.new_module") %>
diff --git a/app/views/canvas/full_zoom/_my_module.html.erb b/app/views/canvas/full_zoom/_my_module.html.erb
index 087428d64..2b0a8edc0 100644
--- a/app/views/canvas/full_zoom/_my_module.html.erb
+++ b/app/views/canvas/full_zoom/_my_module.html.erb
@@ -30,7 +30,11 @@
<% if can_manage_module?(my_module) %>
- <%= link_to due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link due-date-refresh" do %>
+ <%= link_to due_date_my_module_path(my_module, format: :json), remote: true, class: "due-date-link due-date-refresh popover_v2",
+ data: {
+ popoverlink: I18n.t('popover_test.link.task.due_date'),
+ popovercontent: I18n.t('popover_test.text.task.due_date')
+ } do %>
<%= render partial: "my_modules/due_date_label.html.erb", locals: { my_module: my_module } %>
<% end %>
<% else %>
diff --git a/app/views/my_modules/_module_header.html.erb b/app/views/my_modules/_module_header.html.erb
index 069149d50..82a335865 100644
--- a/app/views/my_modules/_module_header.html.erb
+++ b/app/views/my_modules/_module_header.html.erb
@@ -9,7 +9,9 @@
-
+
<% if can_manage_module?(@my_module) %>
<%= link_to due_date_my_module_path(@my_module, format: :json), remote: true, class: "due-date-link", style: "color: inherit" do %>
diff --git a/app/views/my_modules/_state_buttons.html.erb b/app/views/my_modules/_state_buttons.html.erb
index 00ac94e46..abf571ce9 100644
--- a/app/views/my_modules/_state_buttons.html.erb
+++ b/app/views/my_modules/_state_buttons.html.erb
@@ -1,6 +1,8 @@