Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
04656e8c
Unverified
Commit
04656e8c
authored
5 years ago
by
Eileen McNaughton
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #14442 from colemanw/drupal8jquery
Conditionally use Drupal's jQuery only if available
parents
64979dea
5d175460
Branches
dependabot/composer/phpoffice/phpspreadsheet-1.29.9
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/crm.drupal8.js
+10
-7
10 additions, 7 deletions
js/crm.drupal8.js
with
10 additions
and
7 deletions
js/crm.drupal8.js
+
10
−
7
View file @
04656e8c
...
...
@@ -17,13 +17,16 @@ localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify('toolbar-item-
// Wait for document.ready so Drupal's jQuery is available to this script
$
(
function
(
$
)
{
// Need Drupal's jQuery to listen to this event
jQuery
(
document
).
on
(
'
drupalToolbarTabChange
'
,
function
(
event
,
tab
)
{
if
(
CRM
.
menubar
&&
CRM
.
menubar
.
position
===
'
below-cms-menu
'
)
{
var
action
=
jQuery
(
tab
).
is
(
'
#toolbar-item-civicrm
'
)
?
'
show
'
:
'
hide
'
;
CRM
.
menubar
[
action
]();
}
});
// If Drupal's jQuery isn't loaded (e.g. on a stripped-down front-end page), we don't need to worry about the toolbar
if
(
window
.
jQuery
)
{
// This event is only triggered by Drupal's copy of jQuery. CRM.$ won't pick it up.
jQuery
(
document
).
on
(
'
drupalToolbarTabChange
'
,
function
(
event
,
tab
)
{
if
(
CRM
.
menubar
&&
CRM
.
menubar
.
position
===
'
below-cms-menu
'
)
{
var
action
=
jQuery
(
tab
).
is
(
'
#toolbar-item-civicrm
'
)
?
'
show
'
:
'
hide
'
;
CRM
.
menubar
[
action
]();
}
});
}
});
})(
CRM
.
$
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment