is there something im doing wrong here?
$('#cancelEdit').on('click', 'button', null, app.core.toggleFilterNavForSummary);
its odd that when i run it this way it works
$('#cancelEdit').on('click', 'button', function(){
app.core.toggleFilterNavForSummary();
});
is my problem in the way im trying to pass the handler, or in the callback itself?
i can say this, the callback has a parameter which it looks for to be passed in, and if its null then it does something differernt. but if you notice above, its null in both.
heres the bulk of the callback handler
core.toggleFilterNavForSummary = function(criteria){
var $liElem,
text,
criteria = criteria || null,
parent = $('#filterSelectedList'),
ulBox = $('#filterCriteria'),
editButton = $('#reviseSearch'),
nav = $('#filterNav');
parent.collapse('show'); //alt - parent.hide();
nav.collapse('hide'); //hide filter dropdown, then show criteria summary
if(criteria){
//empty first li in filter criteria list, and remove everything AFTER it.
ulBox.find('li:first-child').empty().nextAll().addClass('hidden');
//now loop selected filter criteria and append html to display
$.each(criteria,function(index,value){
if(index == 'a'){
var $liElem = ulBox.find('.a'),
text = $liElem.data('text'),
capitalized = value.charAt(0).toUpperCase() + value.substring(1).toLowerCase();
$liElem.empty().append(text + capitalized);
} else if (index == 'b') {
var $liElem = ulBox.find('.b');
$liElem.empty().append(value).removeClass('hidden');
} else if (index == 'c') {
$liElem = ulBox.find('.c');
$liElem.empty().append(value).removeClass('hidden');
}
});
}
ulBox.removeClass('hidden');
editButton.removeClass('hidden');
// unhidde result-dashboard
$('#result-dashboard').removeClass('hidden');
// unhide results
$('#results').removeClass('hidden');
}
the problem is, when i pass it in as null using the 1st form above, its not actually null, its coming back as this
Object { originalEvent=Event click, type="click", timeStamp=18446744071694688000, more...}