})
.on('show.smapi', function(e, menu) {
// Focus menu when opened with an accesskey
- $(menu).siblings('a[accesskey]:not(:hover)').focus();
+ $(menu).siblings('a[accesskey]').focus();
})
.smartmenus(CRM.menubar.settings);
initialized = true;
.addClass('crm-menubar-hidden')
.removeClass('crm-menubar-visible');
if (showMessage === true && $('#crm-notification-container').length && initialized) {
- var alert = CRM.alert('<a href="#" id="crm-restore-menu" style="text-align: center; margin-top: -8px;">' + _.escape(ts('Restore CiviCRM Menu')) + '</a>', '', 'none', {expires: 10000});
+ var alert = CRM.alert('<a href="#" id="crm-restore-menu" >' + _.escape(ts('Restore CiviCRM Menu')) + '</a>', ts('Menu hidden'), 'none', {expires: 10000});
$('#crm-restore-menu')
- .button({icons: {primary: 'fa-undo'}})
.click(function(e) {
e.preventDefault();
alert.close();
CRM.menubar.show(speed);
- })
- .parent().css('text-align', 'center').find('.ui-button-text').css({'padding-top': '4px', 'padding-bottom': '4px'});
+ });
}
},
open: function(itemName) {
$('#crm-qsearch-input').focus().autocomplete("search");
}, 1);
});
- $('.crm-quickSearchField input[value="' + CRM.cache.get('quickSearchField', 'sort_name') + '"]').prop('checked', true);
+ var savedDefault = CRM.cache.get('quickSearchField');
+ if (savedDefault) {
+ $('.crm-quickSearchField input[value="' + savedDefault + '"]').prop('checked', true);
+ } else {
+ $('.crm-quickSearchField:first input').prop('checked', true);
+ }
setQuickSearchValue();
$('#civicrm-menu').on('activate.smapi', function(e, item) {
return !$('ul.crm-quickSearch-results').is(':visible:not(.ui-state-disabled)');