Skip to content
Snippets Groups Projects
Commit 62c20d1e authored by colemanw's avatar colemanw
Browse files

Alter menubar breakpoint to match WP admin theme

parent c4560ed2
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@
* @method static setHttpHeader(string $name, string $value) Set http header.
* @method static array synchronizeUsers() Create CRM contacts for all existing CMS users.
* @method static appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_coreResourceList.
* @method static alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_getAssetUrl.
*/
class CRM_Utils_System {
......
......@@ -919,6 +919,14 @@ abstract class CRM_Utils_System_Base {
public function appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) {
}
/**
* Modify dynamic assets.
*
* @param \Civi\Core\Event\GenericHookEvent $e
*/
public function alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) {
}
/**
* @param string $name
* @param string $value
......
......@@ -807,6 +807,16 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
$e->list[] = 'js/crm.wordpress.js';
}
/**
* @inheritDoc
*/
public function alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) {
// Set menubar breakpoint to match WP admin theme
if ($e->asset == 'crm-menubar.css') {
$e->params['breakpoint'] = 783;
}
}
/**
* @inheritDoc
*/
......
......@@ -322,6 +322,7 @@ class Container {
$dispatcher->addListener('hook_civicrm_buildAsset', ['\CRM_Utils_VisualBundle', 'buildAssetCss']);
$dispatcher->addListener('hook_civicrm_buildAsset', ['\CRM_Core_Resources', 'renderMenubarStylesheet']);
$dispatcher->addListener('hook_civicrm_coreResourceList', ['\CRM_Utils_System', 'appendCoreResources']);
$dispatcher->addListener('hook_civicrm_getAssetUrl', ['\CRM_Utils_System', 'alterAssetUrl']);
$dispatcher->addListener('civi.dao.postInsert', ['\CRM_Core_BAO_RecurringEntity', 'triggerInsert']);
$dispatcher->addListener('civi.dao.postUpdate', ['\CRM_Core_BAO_RecurringEntity', 'triggerUpdate']);
$dispatcher->addListener('civi.dao.postDelete', ['\CRM_Core_BAO_RecurringEntity', 'triggerDelete']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment