-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1568 from Kajabi/develop
Next version bump
- Loading branch information
Showing
42 changed files
with
5,057 additions
and
6,859 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module SageGridHelper | ||
def grid_column_classes(col) | ||
column_classes = "" | ||
|
||
if col.breakpoint.present? && col.size.present? | ||
# if both breakpoint and sizing are provided | ||
column_classes << "sage-col--#{col.breakpoint}-#{col.size} " | ||
elsif !col.breakpoint.present? && col.size.present? | ||
# or if only a size is provided, without a breakpoint | ||
column_classes << "sage-col-#{col.size} " | ||
elsif !col.breakpoint.present? && !col.size.present? && grid_col_legacy(col) | ||
# or if a legacy individual breakpoint is provided | ||
grid_col_breakpoint_individual(col, column_classes) | ||
else | ||
# otherwise we display a default unsized column | ||
column_classes << "sage-col " | ||
end | ||
|
||
column_classes << col.generated_css_classes | ||
end | ||
|
||
private | ||
|
||
def grid_col_legacy(col) | ||
col.xlarge.present? || col.large.present? || col.medium.present? || col.small.present? | ||
end | ||
|
||
def grid_col_breakpoint_individual(col, column_classes) | ||
column_classes << "sage-col--xl-#{col.xlarge} " if col.xlarge.present? | ||
column_classes << "sage-col--lg-#{col.large} " if col.large.present? | ||
column_classes << "sage-col--md-#{col.medium} " if col.medium.present? | ||
column_classes << "sage-col--sm-#{col.small} " if col.small.present? | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
13 changes: 1 addition & 12 deletions
13
docs/lib/sage_rails/app/views/sage_components/_sage_grid_col.html.erb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
<% has_infix = component.breakpoint || component.size || component.small || component.medium || component.large %> | ||
|
||
<div class=" | ||
<%= "sage-col" if !has_infix -%> | ||
<%= "sage-col-#{component.size}" if component.size -%> | ||
<%= "sage-col--#{component.breakpoint}-#{component.size}" if component.breakpoint && component.size -%> | ||
<%= "sage-col--sm-#{component.small}" if component.small%> | ||
<%= "sage-col--md-#{component.medium}" if component.medium%> | ||
<%= "sage-col--lg-#{component.large}" if component.large%> | ||
<%= "sage-col--xl-#{component.xlarge}" if component.xlarge%> | ||
<%= component.generated_css_classes %> | ||
" <%= component.generated_html_attributes.html_safe %>> | ||
<div class="<%= grid_column_classes(component) %>" <%= component.generated_html_attributes.html_safe %>> | ||
<%= component.content %> | ||
</div> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.