Guest User

Untitled

a guest
Oct 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <aura:component implements="flexipage:availableForAllPageTypes" access="global">
  2. <!-- attributes -->
  3. <lightning:utilityBarAPI aura:id="utilitybar" />
  4. <aura:attribute name="hasUtilityBar" type="Boolean" default="false" />
  5.  
  6. <!-- event handlers -->
  7. <aura:handler name="init" value="{! this }" action="{! c.init }" />
  8.  
  9. <p>Is there a utility bar? {! v.hasUtilityBar ? 'Yes' : 'No' }</p>
  10. </aura:component>
  11.  
  12. ({
  13. init: function (component, event, helper) {
  14. var utilityAPI = component.find('utilitybar');
  15.  
  16. utilityAPI.getAllUtilityInfo().then(function (response) {
  17. if (typeof response !== 'undefined') {
  18. component.set('v.hasUtilityBar', true);
  19. } else {
  20. component.set('v.hasUtilityBar', false);
  21. }
  22. });
  23. }
  24. });
Add Comment
Please, Sign In to add comment