X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.menubar.js;h=a9177bb5b2ced16a5bcff09953e02aa41d9acc2c;hb=f811d576086346ead03b43224d77ceffc0dae700;hp=d28f0983498f6a908f41c5b3839575871977f3ba;hpb=13c25b60851aedb58886592e82bf916bd54ad280;p=civicrm-core.git diff --git a/js/crm.menubar.js b/js/crm.menubar.js index d28f098349..a9177bb5b2 100644 --- a/js/crm.menubar.js +++ b/js/crm.menubar.js @@ -336,7 +336,33 @@ CRM.menubar.open('QuickSearch'); } } - }); + }) + .autocomplete( "instance" )._renderItem = function( ul, item ) { + var uiMenuItemWrapper = $("
"); + if (item.value == 0) { + uiMenuItemWrapper.text(item.label); + } + else { + uiMenuItemWrapper.append($('') + .attr('href', CRM.url('civicrm/contact/view', {reset: 1, cid: item.value})) + .css({ display: 'block' }) + .text(item.label) + .click(function(e) { + if (e.ctrlKey || e.shiftKey || e.altKey) { + // Special-clicking lets you open several tabs. + e.stopPropagation(); + } + else { + // Fall back to original behaviour. + e.preventDefault(); + } + })); + } + + return $( "
  • " ) + .append(uiMenuItemWrapper) + .appendTo( ul ); + }; $('#crm-qsearch > a').keyup(function(e) { if ($(e.target).is(this)) { $('#crm-qsearch-input').focus();