Skip to content
Snippets Groups Projects
Commit 71f2e3b0 authored by khawkins98's avatar khawkins98
Browse files

Fix issue with live filter loading, execution

parent 90f4ddd9
No related branches found
No related tags found
No related merge requests found
......@@ -1027,11 +1027,11 @@
If not, load this JS after jQuery. -->
<script defer src="libraries/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
window.onload = function() {
window.addEventListener('load',function() {
$(document).ready(function() {
$("#table-sort-demo").tablesorter();
});
}
});
</script>
</section>
......@@ -1209,7 +1209,7 @@
If not, load this JS after jQuery. -->
<script defer src="libraries/LiveFilter/js/jquery.liveFilter.js"></script>
<script type="text/javascript">
window.onload = function() {
window.addEventListener('load',function() {
$(document).ready(function() {
$('#livefilterdemo').liveFilter({
fitlerTargetCustomDiv: 'div.live-filter-target-granularity',
......@@ -1217,7 +1217,7 @@
noMatches: '<p>No matching papers found.</p><a class="button" href="#">You could add a link to advanced search</a> '
});
});
}
});
</script>
</div> <!-- /livefilter -->
......
......@@ -12,7 +12,6 @@
(function($){
$.fn.liveFilter = function (settings) {
// Default settings
var defaults = {
delay: 0,
......@@ -36,7 +35,7 @@
// Cache our wrapper element and find our target list.
var wrap = $(this);
var filterTarget = wrap.find('ul, ol, table,' + options.fitlerTargetCustomDiv);
var filterTarget = wrap.find('ul, ol, table,div');
// Add no matches text.
wrap.append('<div class="nomatches">'+options.noMatches+'</div>');
......@@ -44,7 +43,7 @@
nomatches.hide();
// Determine our child element type.
if (filterTarget.is(options.fitlerTargetCustomDiv)) {
if (options.fitlerTargetCustomDiv) {
child = options.fitlerTargetCustomDiv;
} else if (filterTarget.is('ul') || filterTarget.is('ol')) {
child = 'li';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment