Commit c7ec7578 authored by colemanw's avatar colemanw

Update KAM to 1.0.beta2

parent 2db3c3a0
......@@ -30,8 +30,7 @@ By default the bar will appear at the top of the screen with a toggle arrow to m
| Event | Description | Example |
| ------ | ----------- | ------- |
| `crmMenuLoad` | Triggered on the page body after menu data loads but *before* the menu is rendered in the dom.<br />This is a good time to add/remove items if you already know what they are at page load. | `$(document).on('crmMenuLoad', function() {` <br /> ` CRM.menubar.addItems(-1, 'Search', myItems);` <br /> `});` |
| `crmLoad` | Triggered on the `#civicrm-menu` element after menu is rendered in the dom. | `$(document).on('crmLoad', '#civicrm-menu', function() {` <br /> ` // Do something now that the menu is rendered` <br /> `});` |
| `crmLoad` | Triggered on the `#civicrm-menu` element after menu is added to the dom.<br />This is a good time to add/remove items if you already know what they are at page load. | `$(document).on('crmLoad', '#civicrm-menu', function() {` <br /> ` CRM.menubar.addItems(-1, 'Search', myItems);` <br /> `});` |
#### Properties
......@@ -56,7 +55,7 @@ By default the bar will appear at the top of the screen with a toggle arrow to m
| `removeItem( itemName )` | Deletes an item from the menu (and all its children).<br />`itemName`: name of item to remove. | `CRM.menubar.removeItem('New Household');` |
| `show( [speed] )` | Shows the menubar if hidden.<br />`speed`: if a number is given, a slidedown animation is used. | `CRM.menubar.show(250);` |
| `spin( [spin] )` | Spins the icon in the home menu.<br />`spin`: pass a boolean to start or stop the spinning, or pass no arguments to toggle. | `CRM.menubar.spin(true); // start` <br /> `CRM.menubar.spin(false); // stop` |
| `togglePosition()` | Toggles between 'over-cms-menu' and 'below-cms-menu'. | `CRM.menubar.togglePosition();` |
| `togglePosition( [persist] )` | Toggles between 'over-cms-menu' and 'below-cms-menu'. By default, persist the change to localStorage. | `CRM.menubar.togglePosition();` |
| `updateItem( item )` | Updates the properties of a menu item (label, url, separator, icon, etc.<br />`item`: object with at least a `name` plus properties to update. | `CRM.menubar.updateItem({name: 'Search', label: 'Find'});` |
Tip: Try pasting those examples into your browser console.
......
......@@ -138,10 +138,19 @@ input#crm-qsearch-input {
}
a.highlighted #crm-qsearch-input,
#crm-qsearch-input:focus,
#crm-qsearch-input:not(:placeholder-shown) {
#crm-qsearch-input.has-user-input {
background-color: white;
width: 130px;
}
input#crm-qsearch-input:-ms-input-placeholder {
font-family: 'FontAwesome';
}
input#crm-qsearch-input::-webkit-input-placeholder {
font-family: 'FontAwesome';
}
input#crm-qsearch-input::-moz-placeholder {
font-family: 'FontAwesome';
}
input#crm-qsearch-input::placeholder {
font-family: 'FontAwesome';
}
......@@ -233,7 +242,7 @@ body.crm-menubar-over-cms-menu #crm-menubar-toggle-position a i {
}
body.crm-menubar-over-cms-menu #civicrm-menu {
z-index: 100000;
z-index: 99999;
}
body.crm-menubar-hidden #civicrm-menu {
......
body.crm-menubar-visible.crm-menubar-over-cms-menu #toolbar-home,
body.crm-menubar-visible.crm-menubar-over-cms-menu #toolbar-menu {
display: none;
}
@media (min-width: 768px) {
body.crm-menubar-visible.crm-menubar-over-cms-menu #toolbar-user {
visibility: hidden;
body.crm-menubar-visible.crm-menubar-over-cms-menu #toolbar {
display: none;
}
body.crm-menubar-visible.crm-menubar-over-cms-menu {
......@@ -87,9 +82,12 @@ body.crm-menubar-visible.crm-menubar-over-cms-menu #toolbar-menu {
@media (max-width: 768px) {
body.toolbar.crm-menubar-visible.crm-menubar-below-cms-menu #toolbar-home {
body.toolbar.crm-menubar-visible #toolbar-home {
visibility: hidden;
}
body.crm-menubar-visible #toolbar-menu {
display: none;
}
body #civicrm-menu-nav .crm-menubar-toggle-btn {
margin-top: 0;
......
......@@ -28,6 +28,9 @@
body.crm-menubar-below-cms-menu.crm-menubar-visible.crm-menubar-wrapped #wpbody {
padding-top: 80px;
}
body.crm-menubar-over-cms-menu.crm-menubar-visible.crm-menubar-wrapped #adminmenuwrap {
margin-top: 40px;
}
}
@media (min-width: 768px) and (max-width: 960px) {
......
......@@ -14,8 +14,8 @@
<url desc="Support">https://github.com/aydun/uk.squiffle.kam</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2018-12-04</releaseDate>
<version>1.0.beta1</version>
<releaseDate>2018-12-11</releaseDate>
<version>1.0.beta2</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.8</ver>
......
......@@ -19,7 +19,7 @@ localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify('toolbar-item-
$(function($) {
// Need Drupal's jQuery to listen to this event
jQuery(document).on('drupalToolbarTabChange', function(event, tab) {
if (CRM.menubar.position === 'below-cms-menu') {
if (CRM.menubar && CRM.menubar.position === 'below-cms-menu') {
var action = jQuery(tab).is('#toolbar-item-civicrm') ? 'show' : 'hide';
CRM.menubar[action]();
}
......
This diff is collapsed.
// http://civicrm.org/licensing
CRM.$(function($) {
$(document)
.on('dialogopen', function(e) {
// Make admin bar hide behind popup windows
$('#adminmenuwrap').css('z-index', '100');
})
.on('dialogclose', function(e) {
if ($('.ui-dialog-content:visible').not(e.target).length < 1) {
// Restore admin bar position
$('#adminmenuwrap').css('z-index', '');
}
})
.on('crmWysiwygCreate', function(e, type, editor) {
if (type === 'ckeditor') {
editor.on('maximize', function(e) {
$('#wpadminbar').toggle(e.data === 2);
});
}
});
// Prevent screen reader shortcuts from changing the document hash and breaking angular routes
$('a.screen-reader-shortcut').click(function() {
var href = $(this).attr('href');
// Show toolbar if hidden
if (href === '#wp-toolbar' && CRM.menubar.position === 'over-cms-menu') {
CRM.menubar.togglePosition(false);
}
$(href).focus();
return false;
});
$('<a href="#crm-qsearch-input" class="screen-reader-shortcut">' + ts("Open CiviCRM Menu") + '</a>')
.prependTo('#adminmenumain')
.click(function() {
CRM.menubar.open('Home');
return false;
});
});
......@@ -30,11 +30,11 @@ function kam_civicrm_coreResourceList(&$list, $region) {
$cms = $cms === 'drupal' ? 'drupal7' : $cms;
$path = 'packages/smartmenus-1.1.0/';
Civi::resources()
->addScriptFile('uk.squiffle.kam', $path . 'jquery.smartmenus.js', 0, 'html-header')
->addScriptFile('uk.squiffle.kam', $path . 'addons/keyboard/jquery.smartmenus.keyboard.js', 1, 'html-header')
->addScriptFile('uk.squiffle.kam', 'js/crm.menubar.js', -9)
->addStyleFile('uk.squiffle.kam', "css/menubar-$cms.css")
->addStyleUrl(\Civi::service('asset_builder')->getUrl('sm-civicrm.css'));
->addStyleFile('uk.squiffle.kam', "css/menubar-$cms.css", -99, 'html-header')
->addStyleUrl(\Civi::service('asset_builder')->getUrl('sm-civicrm.css'), -98, 'html-header')
->addScriptFile('uk.squiffle.kam', $path . 'jquery.smartmenus.js', -99, 'html-header')
->addScriptFile('uk.squiffle.kam', $path . 'addons/keyboard/jquery.smartmenus.keyboard.js', -98, 'html-header')
->addScriptFile('uk.squiffle.kam', 'js/crm.menubar.js', -97, 'html-header');
$list[] = [
'menubar' => [
'position' => $position,
......@@ -69,6 +69,12 @@ function kam_civicrm_alterContent(&$content, $context, $tplName, &$object) {
$override = ['scriptUrl' => $resources->getUrl('uk.squiffle.kam', 'js/crm.drupal8.js', TRUE)];
$region->update($drupal8['name'], $override);
}
// Override wordpress.js file
$wordpress = $region->get($resources->getUrl('civicrm', 'js/crm.wordpress.js', TRUE));
if ($wordpress) {
$override = ['scriptUrl' => $resources->getUrl('uk.squiffle.kam', 'js/crm.wordpress.js', TRUE)];
$region->update($wordpress['name'], $override);
}
// Override core joomla.css file
$joomlaCss = $region->get($resources->getUrl('civicrm', 'css/joomla.css', TRUE));
if ($joomlaCss) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment