Skip to content

Commit 22f39a1

Browse files
committed
Merge branch 'tess-1.2' of github.com:ElixirTeSS/TeSS into tess-1.2
2 parents 96fc01b + c924726 commit 22f39a1

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

app/assets/javascripts/application.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function redirect_to_sort_url(){
6767

6868
function reposition_tiles(container, tileClass){
6969
var $container = $("." + container);
70-
70+
7171
$container.imagesLoaded(function () {
7272
$container.masonry({
7373
// options...
@@ -192,6 +192,8 @@ document.addEventListener("turbolinks:load", function() {
192192
return false;
193193
}
194194
});
195+
196+
Nodes.init();
195197
});
196198

197199
function truncateWithEllipses(text, max)

app/assets/javascripts/nodes.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@ const Nodes = {
2525
parent.removeClass('pending-delete');
2626
}
2727
}
28+
},
29+
init: function () {
30+
$('[data-role="add-node-staff-button"]').each(function () {
31+
var template = $(this).next('[data-role="add-node-staff-template"]');
32+
// Store the template's HTML on this DOM object
33+
$(this).data('template', template.html());
34+
// Delete the template from the DOM, don't need anymore.
35+
template.remove();
36+
// Bind click event
37+
$(this).click(Nodes.addStaff);
38+
});
39+
40+
$('#staff-list').on('change', '[data-role="delete-node-staff-button"]', Nodes.removeStaff);
2841
}
2942
};
30-
31-
$(function () {
32-
$('[data-role="add-node-staff-button"]').each(function () {
33-
var template = $(this).next('[data-role="add-node-staff-template"]');
34-
// Store the template's HTML on this DOM object
35-
$(this).data('template', template.html());
36-
// Delete the template from the DOM, don't need anymore.
37-
template.remove();
38-
// Bind click event
39-
$(this).click(Nodes.addStaff);
40-
});
41-
42-
$('#staff-list').on('change', '[data-role="delete-node-staff-button"]', Nodes.removeStaff);
43-
});

0 commit comments

Comments
 (0)