-
-
Save robdecker/4da5d336291967ea9b3b53e7db20a9cd to your computer and use it in GitHub Desktop.
[Prevent the Administrative Toolbar from popping out as a sidebar when screen width is reduced] #d8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, Drupal, document, window) { | |
/** | |
* Prevents the Administrative Toolbar from popping out as a sidebar when | |
* screen width is reduced. | |
*/ | |
Drupal.behaviors.customToolbarResizeTweak = { | |
attach: function (context) { | |
window.matchMedia('(min-width: 975px)').addListener(function(event) { | |
event.matches ? $('#toolbar-item-administration', context).click() : $('.toolbar-item.is-active', context).click(); | |
}); | |
} | |
} | |
}(jQuery, Drupal, document, window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment