Skip to content
Snippets Groups Projects
Commit 92208b45 authored by khawkins98's avatar khawkins98
Browse files

Add ability to log livefilter search #123

parent a458148a
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,8 @@
$.fn.liveFilter = function (settings) {
// Default settings
var defaults = {
delay: 0,
delay: 50,
analyticsLogging: false, // log to google analytics through foundationExtendEBI.js
defaultText: 'Type to Filter:',
resetText: 'Reset',
noMatches: 'No Matches',
......@@ -116,7 +117,7 @@
});
input.blur(function() {
var currentVal = $(this).val();
var currentVal = $(this).val();
if (currentVal === '') {
$(this).val(options.defaultText);
}
......@@ -141,7 +142,7 @@
}
// Setting timeout for performance reasons.
keyDelay = setTimeout(function () {
keyDelay = setTimeout(function () {
filter = input.val().toLowerCase();
var visible = 0;
......@@ -152,6 +153,11 @@
$(this).hide();
})
} else {
if (analyticsLogging) {
if ($('body').hasClass('google-analytics-loaded')) {
analyticsTrackInteraction(filter,'Live filter search');
}
}
// Iterate through list and show/hide the proper elements.
list.each(function(i) {
text = $(this).text().toLowerCase();
......@@ -200,4 +206,4 @@
}
}
})(jQuery);
\ No newline at end of file
})(jQuery);
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