Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion NavigationButton/NavigationButton.cmp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

<aura:attribute name="NavigateButtonClass" type="String" default="" access="public"/>
<aura:attribute name="LastElement" type="boolean" default="false" access="global"/>

<aura:attribute name="appendFloatClearDiv" type="Boolean" default="True" access="global"/>
<aura:attribute name="appendSldsCardStyle" type="Boolean" default="True" access="global"/>

<lightning:navigation aura:id="navService"/>
<lightning:quickActionAPI aura:id="quickActionAPI" />
Expand Down Expand Up @@ -68,4 +71,4 @@
</div>


</aura:component>
</aura:component>
5 changes: 4 additions & 1 deletion NavigationButton/NavigationButton.design
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@


<design:attribute name="LastElement" label="zDEPRECATED - Last Button" description="Used to end the horizontal positioning. Make true if the last button in a line of buttons" default="false"/>

<design:attribute name="appendFloatClearDiv" label="Append Float Clear Div?" description="By default, a div is appended after the button to clear the floats. Set to False to prevent this." default="true" />
<design:attribute name="appendSldsCardStyle" label="Append .slds-card Style?" description="By default, a style is appended after the button to set the .slds-card style to min-height: 6.5REM;. Set to False to prevent this." default="true" />


</design:component>
</design:component>
24 changes: 13 additions & 11 deletions NavigationButton/NavigationButtonRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
var elements = document.querySelectorAll('[data-holder="NavButtonHolder"]');

//add after last element
var lastElement = elements[elements.length-1 ];
var newItem = document.createElement("div");
newItem.setAttribute("style", "clear:both;display:block");
newItem.setAttribute("special-type", "floatClear");
lastElement.appendChild(newItem);

if(component.get("v.appendFloatClearDiv")) {
var lastElement = elements[elements.length-1 ];
var newItem = document.createElement("div");
newItem.setAttribute("style", "clear:both;display:block");
newItem.setAttribute("special-type", "floatClear");
lastElement.appendChild(newItem);
}

//Always ensure a button is clickable
var newCSSstyle= document.createElement("style");
newCSSstyle.innerHTML = '.slds-card {clear: both; min-height: 6.5REM;' ;
lastElement.appendChild(newCSSstyle);

if(component.get("v.appendSldsCardStyle")) {
var newCSSstyle= document.createElement("style");
newCSSstyle.innerHTML = '.slds-card {clear: both; min-height: 6.5REM;' ;
lastElement.appendChild(newCSSstyle);
}


//STop weird alignment from
Expand All @@ -27,4 +29,4 @@


}
})
})