Guest User

Untitled

a guest
Dec 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. <aura:component controller="Question" implements="flexipage:availableForAllPageTypes" access="global" >
  2. <!--<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>-->
  3. <ltng:require scripts="{!$Resource.unload}" afterScriptsLoaded="{!c.doInit}" />
  4. <aura:attribute name="recordId" type="String" default="0017F00000aMjJWQA0"/>
  5. <aura:attribute name="nonHoverList" type="String[]" default=""/>
  6. <aura:attribute name="hoverList" type="String[]" default=""/>
  7. <aura:attribute name="startWithNonHover" type="Boolean" default=""/>
  8. <aura:attribute name="noneChecked" type="Boolean" default="false"/>
  9. <aura:attribute name="options" type="List" default="[
  10. {'label': 'Ross', 'value': 'option1'},
  11. {'label': 'Rachel', 'value': 'option2'}
  12. ]"/>
  13. <aura:attribute name="value" type="List" default="option1"/>
  14.  
  15. <div class="slds-box">
  16. <aura:iteration items="{!v.nonHoverList}" var="nonHov" indexVar="nonHovIndex">
  17. <lightning:formattedRichText value="{!nonHov}"/>
  18. <aura:iteration items="{!v.hoverList}" var="hov" indexVar="hovIndex">
  19. <aura:if isTrue="{!nonHovIndex == hovIndex}">
  20. <p><button style="text-decoration:underline;" label="{!hov}" class="slds-button">{!hov}</button>
  21. <lightning:helptext content="XYZ"/>
  22. &nbsp;
  23. </p>
  24. </aura:if>
  25. </aura:iteration>
  26. </aura:iteration>
  27.  
  28. <lightning:checkboxGroup name="Checkbox Group"
  29. label="Select all that apply:"
  30. options="{! v.options }"
  31. value="{! v.value }"
  32. onchange="{! c.handleChange }"/>
  33. </div>
  34. </aura:component>
  35.  
  36. unload.js
  37.  
  38.  
  39. var validNavigation = false;
  40. function endSession() {
  41. // Browser or broswer tab is closed
  42. // Do sth here ...
  43. alert("bye");
  44. }
  45.  
  46.  
  47. window.onbeforeunload = function() {
  48. if (!validNavigation) {
  49. endSession();
  50. }
  51. }
Add Comment
Please, Sign In to add comment