Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (customSearch) {
customSearch(searchString, columns);
} else {
search.list();
}
}
list.update();
list.trigger('searchComplete');
return list.visibleItems;
};
list.handlers.searchStart = list.handlers.searchStart || [];
list.handlers.searchComplete = list.handlers.searchComplete || [];
events.bind(getByClass(list.listContainer, list.searchClass), 'keyup', function(e) {
var target = e.target || e.srcElement; // IE have srcElement
searchMethod(target.value);
});
list.helpers.toString = toString;
return searchMethod;
};
if (customSearch) {
customSearch(searchString, columns);
} else {
search.list();
}
}
list.update();
list.trigger('searchComplete');
return list.visibleItems;
};
list.handlers.searchStart = list.handlers.searchStart || [];
list.handlers.searchComplete = list.handlers.searchComplete || [];
events.bind(getByClass(list.listContainer, list.searchClass), 'keyup', function(e) {
var target = e.target || e.srcElement, // IE have srcElement
alreadyCleared = (target.value === "" && !list.searched);
if (!alreadyCleared) { // If oninput already have resetted the list, do nothing
searchMethod(target.value);
}
});
// Used to detect click on HTML5 clear button
events.bind(getByClass(list.listContainer, list.searchClass), 'input', function(e) {
var target = e.target || e.srcElement;
if (target.value === "") {
searchMethod('');
}
});
list.helpers.toString = toString;
buttons.setOrder(options);
options.sortFunction = options.sortFunction || list.sortFunction;
list.items.sort(function(a, b) {
return options.sortFunction(a, b, options);
});
list.update();
list.trigger('sortComplete');
};
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || [];
list.handlers.sortComplete = list.handlers.sortComplete || [];
buttons.els = getByClass(list.listContainer, list.sortClass);
events.bind(buttons.els, 'click', sort);
list.on('searchStart', buttons.clear);
list.on('filterStart', buttons.clear);
// Helpers
list.helpers.classes = classes;
list.helpers.naturalSort = naturalSort;
list.helpers.events = events;
list.helpers.getAttribute = getAttribute;
return sort;
};
return list.visibleItems;
};
list.handlers.searchStart = list.handlers.searchStart || [];
list.handlers.searchComplete = list.handlers.searchComplete || [];
events.bind(getByClass(list.listContainer, list.searchClass), 'keyup', function(e) {
var target = e.target || e.srcElement, // IE have srcElement
alreadyCleared = (target.value === "" && !list.searched);
if (!alreadyCleared) { // If oninput already have resetted the list, do nothing
searchMethod(target.value);
}
});
// Used to detect click on HTML5 clear button
events.bind(getByClass(list.listContainer, list.searchClass), 'input', function(e) {
var target = e.target || e.srcElement;
if (target.value === "") {
searchMethod('');
}
});
list.helpers.toString = toString;
return searchMethod;
};
buttons.setOrder(options);
options.sortFunction = options.sortFunction || list.sortFunction;
list.items.sort(function(a, b) {
return options.sortFunction(a, b, options);
});
list.update();
list.trigger('sortComplete');
};
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || [];
list.handlers.sortComplete = list.handlers.sortComplete || [];
buttons.els = getByClass(list.listContainer, list.sortClass);
events.bind(buttons.els, 'click', sort);
list.on('searchStart', buttons.clear);
list.on('filterStart', buttons.clear);
// Helpers
list.helpers.classes = classes;
list.helpers.naturalSort = naturalSort;
list.helpers.events = events;
list.helpers.getAttribute = getAttribute;
return sort;
};
if (customSearch) {
customSearch(searchString, columns);
} else {
search.list();
}
}
list.update();
list.trigger('searchComplete');
return list.visibleItems;
};
list.handlers.searchStart = list.handlers.searchStart || [];
list.handlers.searchComplete = list.handlers.searchComplete || [];
events.bind(getByClass(list.listContainer, list.searchClass), 'keyup', function(e) {
var target = e.target || e.srcElement, // IE have srcElement
alreadyCleared = (target.value === "" && !list.searched);
if (!alreadyCleared) { // If oninput already have resetted the list, do nothing
searchMethod(target.value);
}
});
// Used to detect click on HTML5 clear button
events.bind(getByClass(list.listContainer, list.searchClass), 'input', function(e) {
var target = e.target || e.srcElement;
if (target.value === "") {
searchMethod('');
}
});
list.helpers.toString = toString;
buttons.setOrder(options);
options.sortFunction = options.sortFunction || list.sortFunction;
list.items.sort(function(a, b) {
return options.sortFunction(a, b, options);
});
list.update();
list.trigger('sortComplete');
};
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || [];
list.handlers.sortComplete = list.handlers.sortComplete || [];
buttons.els = getByClass(list.listContainer, list.sortClass);
events.bind(buttons.els, 'click', sort);
list.on('searchStart', buttons.clear);
list.on('filterStart', buttons.clear);
// Helpers
list.helpers.classes = classes;
list.helpers.naturalSort = naturalSort;
list.helpers.events = events;
list.helpers.getAttribute = getAttribute;
return sort;
};
buttons.setOrder(options);
options.sortFunction = options.sortFunction || list.sortFunction;
list.items.sort(function(a, b) {
return options.sortFunction(a, b, options);
});
list.update();
list.trigger('sortComplete');
};
// Add handlers
list.handlers.sortStart = list.handlers.sortStart || [];
list.handlers.sortComplete = list.handlers.sortComplete || [];
buttons.els = getByClass(list.listContainer, list.sortClass);
events.bind(buttons.els, 'click', sort);
list.on('searchStart', buttons.clear);
list.on('filterStart', buttons.clear);
// Helpers
list.helpers.classes = classes;
list.helpers.naturalSort = naturalSort;
list.helpers.events = events;
list.helpers.getAttribute = getAttribute;
return sort;
};
exports.bind = function(el, type, fn, capture){
if (!isCollection(el)) {
events.bind(el, type, fn, capture);
} else if ( el && el[0] !== undefined ) {
for ( var i = 0; i < el.length; i++ ) {
events.bind(el[i], type, fn, capture);
}
}
};
CssEmitter.prototype.bind = function(fn){
for (var i=0; i < watch.length; i++) {
events.bind(this.el, watch[i], fn);
}
return this;
};