Newer Version Available
isUtilityPoppedOut() for Lightning Experience
Determines whether the utility is in a popped-out state.
Arguments
None
Sample Code
This component has a button that, when pressed, states whether the current utility is popped out or not.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:utilityBarAPI aura:id="utilitybar" />
3 <lightning:button label="Is Utility popped out?" onclick="{! c.isUtilityPoppedOut }" />
4 <ui:inputTextArea aura:id="isUtilityPoppedOut" />
5</aura:component>Controller code:
1({
2 isUtilityPoppedOut : function(component, event, helper) {
3 var utilityBarAPI = component.find("utilitybar");
4 utilityBarAPI.isUtilityPoppedOut().then(function(response) {
5 component.find('isUtilityPoppedOut').set('v.value', response);
6 })
7 .catch(function(error) {
8 console.log(error);
9 });
10 }
11})