select: function (event, ui) {
if (ui.item.value > 0) {
document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: ui.item.value});
+ } else {
+ document.location = CRM.url('civicrm/contact/search/advanced', {reset: 1});
}
return false;
},
var $menu = $('#sort_name_navigation').autocomplete('widget');
if ($('li.ui-menu-item', $menu).length === 1) {
var cid = $('li.ui-menu-item', $menu).data('ui-autocomplete-item').value;
- document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: cid});
- return false;
+ if (cid > 0) {
+ document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: cid});
+ return false;
+ }
}
});
// Close menu after selecting an item