Last active
March 24, 2016 21:14
-
-
Save msrivastav13/d737c480be26df407f7b to your computer and use it in GitHub Desktop.
Lightning Component For Contact Support Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="forceCommunity:availableForAllPageTypes"> | |
<aura:attribute name="supportURL" type="string" default="/s/contactsupport"/> | |
<ui:button aura:id="button" buttonTitle="Contact Support" label="Contact Support" press="{!c.navigate}" class="uiButton forceCommunityAskCommunity"/> | |
</aura:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<design:component> | |
<design:attribute name="supportURL" label="Support URL" description="Please add support URL for the button" /> | |
</design:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
navigate : function(component, event, helper) { | |
//Find the text value of the component with aura:id set to "address" | |
var address = component.get("v.supportURL"); | |
var urlEvent = $A.get("e.force:navigateToURL"); | |
urlEvent.setParams({ | |
"url": address, | |
"isredirect" :false | |
}); | |
urlEvent.fire(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment