1({2 handleOnUtilityClick: function(component, event, helper){3 var utilityBarAPI = component.find("utilitybar");4 var eventHandler = function(response){5 console.log(response);6};78 utilityBarAPI.onUtilityClick({9 eventHandler: eventHandler10}).then(function(result){11 console.log(result);12}).catch(function(error){13 console.log(error);14});15}16})
Aura Components Response
This method returns a promise that, upon success, resolves to true, and is rejected on error. The eventHandler expects a response JSON object containing the following fields.
Name
Type
Description
utilityId
string
The ID of the utilityBar item button that was clicked.
panelVisible
boolean
False if the utility item panel is hidden after the button is clicked. True if the utility item panel is visible after the button is clicked.