Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tymees committed Apr 9, 2024
2 parents 51de62c + 9c56f9d commit 26bb7aa
Showing 1 changed file with 50 additions and 48 deletions.
98 changes: 50 additions & 48 deletions src/cdh/core/static/cdh.core/js/common.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
$(function() {
// Turns al tables with the dt class into datatable tables
$('table.dt').DataTable( {
dom: 'Bfrtip',
buttons : [
'copyHtml5',
'csvHtml5',
'pdfHtml5',
'print',
'pageLength'
],
order: [[0, 'desc']],
lengthMenu: [
[10, 20, 50, -1],
["10", "20", "50", "\u221e"]
],
responsive: true,
paginationType: "full_numbers",
} );
(function($) {
$(function() {
// Turns al tables with the dt class into datatable tables
$('table.dt').DataTable( {
dom: 'Bfrtip',
buttons : [
'copyHtml5',
'csvHtml5',
'pdfHtml5',
'print',
'pageLength'
],
order: [[0, 'desc']],
lengthMenu: [
[10, 20, 50, -1],
["10", "20", "50", "\u221e"]
],
responsive: true,
paginationType: "full_numbers",
} );

// Enables select2 for all select boxes in forms
$('form table select').select2({
'width': 'style'
});
// Enables select2 for all select boxes in forms
$('form table select').select2({
'width': 'style'
});

// Turns all help text into nice (i) icons with qTip hover-text
$("[id^=id]").each(function() {
let help = $(this).nextAll('.helptext');
if (help.html())
{
let label = $(this).parent().parent().find('th label').first();
let icon = $('<span class="icon-info"></span>');
icon.html('&nbsp;');
icon.appendTo(label);
icon.qtip({
content: {
text: help.html(),
},
hide: {
fixed: true,
delay: 500,
},
});
// Turns all help text into nice (i) icons with qTip hover-text
$("[id^=id]").each(function() {
let help = $(this).nextAll('.helptext');
if (help.html())
{
let label = $(this).parent().parent().find('th label').first();
let icon = $('<span class="icon-info"></span>');
icon.html('&nbsp;');
icon.appendTo(label);
icon.qtip({
content: {
text: help.html(),
},
hide: {
fixed: true,
delay: 500,
},
});

// Django inserts an br when a help_text is present. Let's remove it
let prevElement = help.prev();
if (prevElement.is('br'))
prevElement.remove();
help.remove();
}
// Django inserts an br when a help_text is present. Let's remove it
let prevElement = help.prev();
if (prevElement.is('br'))
prevElement.remove();
help.remove();
}
});
});
});
})(jQuery);

0 comments on commit 26bb7aa

Please sign in to comment.