CRM-18652 - Improve style of no-results item
authorColeman Watts <coleman@civicrm.org>
Sun, 5 Jun 2016 21:54:33 +0000 (15:54 -0600)
committerColeman Watts <coleman@civicrm.org>
Sun, 5 Jun 2016 21:54:33 +0000 (15:54 -0600)
css/civicrmNavigation.css
templates/CRM/common/navigation.js.tpl

index c5c94c2c382f131647cb98e777f02047f4eb3fe0..c257260a5419edb66266c9c2afd787dc7cb6aa44 100644 (file)
@@ -162,3 +162,12 @@ li.menu-separator{
 #civicrm-menu > li.menumain {
   height: 19px !important;
 }
+
+/* No results */
+.crm-quickSearch-results.ui-menu-disabled {
+  opacity: .9;
+  background-color: #f8f8f8;
+}
+.crm-quickSearch-results.ui-menu-disabled li {
+  cursor: default;
+}
index d762766970d25e8bdfe98a50c0912147087c986e..06129b3686d76e36d8f2d9e9c2102eab783fa036 100644 (file)
@@ -104,10 +104,12 @@ $('#civicrm-menu').ready(function() {
         CRM.api3('contact', 'getquick', params).done(function(result) {
           var ret = [];
           if (result.values.length > 0) {
+            $('#sort_name_navigation').autocomplete('widget').menu('option', 'disabled', false);
             $.each(result.values, function(k, v) {
               ret.push({value: v.id, label: v.data});
             });
           } else {
+            $('#sort_name_navigation').autocomplete('widget').menu('option', 'disabled', true);
             ret.push({value: '0', label: {/literal}'{ts escape='js'}None found.{/ts}'{literal}});
           }
           response(ret);
@@ -119,14 +121,14 @@ $('#civicrm-menu').ready(function() {
       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;
       },
       create: function() {
         // Place menu in front
-        $(this).autocomplete('widget').css('z-index', $('#civicrm-menu').css('z-index'));
+        $(this).autocomplete('widget')
+          .addClass('crm-quickSearch-results')
+          .css('z-index', $('#civicrm-menu').css('z-index'));
       }
     })
     .keydown(function() {