Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to all settings applied only in desktop view #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions components/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@
</div>
</header>
</div>

{%- include "ico-desktop" -%}
12 changes: 12 additions & 0 deletions components/ico-desktop.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<svg width="0" height="0" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="ico-desktop" fill="#000">
<title>{{ "desktop" | lce }}</title>
<path opacity=".3" fill-rule="evenodd" clip-rule="evenodd" d="M11.067 19.867v-2.4a1.133 1.133 0 0 1 2.266 0v2.4h1.7a.567.567 0 0 1 0 1.133H9.367a.567.567 0 0 1 0-1.133h1.7Z"/>
<path d="M3.267 5.267v11.066h17.866V5.267H3.267ZM4.55 4h15.3c1.408 0 2.55 1.015 2.55 2.267v9.066c0 1.252-1.142 2.267-2.55 2.267H4.55C3.142 17.6 2 16.585 2 15.333V6.267C2 5.015 3.142 4 4.55 4Z"/>
<path opacity=".1" fill-rule="evenodd" clip-rule="evenodd" d="M3 5v12h19V5H3Z"/>
</g>
</svg>

{%- capture "desktop-icon" -%}
<svg width="24" height="24" class="mar_l-4"><use href="#ico-desktop"></use></svg>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably make the width and height values the same value as the container's line-height (which in this case is 22px), because it might look more natural that way. We might want to consult with the designer here.

{%- endcapture -%}
2 changes: 1 addition & 1 deletion components/settings-blog-page-layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
settingsBtn: document.querySelector('.js-blog-layout-settings-editor'),
menuItems: [
{
"title": {{ "blog_layout" | lce | json }},
"title": '{{ "blog_layout" | lce | append: desktop-icon }}',
"type": "radio",
"key": "blog_layout",
"list": [
Expand Down
8 changes: 4 additions & 4 deletions components/settings-menu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
settingsBtn: document.querySelector('.js-menu-settings-btn'),
menuItems: [
{
"title": {{ "menu_alignment" | lce | json }},
"title": '{{ "menu_alignment" | lce | append: desktop-icon }}',
"type": "radio",
"key": "positioning",
"list": [
Expand All @@ -70,7 +70,7 @@
]
},
{
"title": {{ "active_page_indicator" | lce | json }},
"title": '{{ "active_page_indicator" | lce | append: desktop-icon }}',
"type": "radio",
"key": "indicator",
"list": [
Expand All @@ -89,14 +89,14 @@
{%- assign pxTr = "units.px" | lce -%}
{%- assign sideMenuCombinedTr = sideMenuWidthTr | append: ' (' | append: pxTr | append: ')' -%}
{
"title": {{ sideMenuCombinedTr | json }},
"title": '{{ sideMenuCombinedTr | append: desktop-icon }}',
"type": "number",
"min": 1,
"key": "max_width",
"placeholder": {{ sideMenuCombinedTr | json }}
},
{
"title": {{ "max_no_of_menu_pages" | lce | json }},
"title": '{{ "max_no_of_menu_pages" | lce | append: desktop-icon }}',
"type": "number",
"key": "max_elements",
"placeholder": {{ "max_no_of_menu_pages" | lce | json }},
Expand Down
30 changes: 15 additions & 15 deletions components/settings-modular-content.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
valuesObj.col_h_padding = "{{_defaultBlockObj.default.col_h_padding}}";
{%- endif -%}
}

if (!('col_min_width' in valuesObj)) {
{%- if _defaultBlockObj[blockColumnsSettingsKey].col_min_width -%}
valuesObj.col_min_width = "{{_defaultBlockObj[blockColumnsSettingsKey].col_min_width}}";
Expand Down Expand Up @@ -143,15 +143,6 @@
{"title": "5", "value": 5}
]
},
{%- assign blockMaxWidthTr = "max_width" | lce -%}
{%- assign blockMaxWidthCombinedTr = blockMaxWidthTr | append: ' (%)' -%}
{
"title": {{ blockMaxWidthCombinedTr| json }},
"type": "number",
"min": 1,
"key": "block_max_width",
"placeholder": {{ blockMaxWidthCombinedTr| json }}
},
{%- assign verticalSpacingTr = "vertical_spacing" | lce -%}
{%- assign pxTr = "units.px" | lce -%}
{%- assign verticalSpacingCombinedTr = verticalSpacingTr | append: ' (' | append: pxTr | append: ')' -%}
Expand All @@ -162,8 +153,17 @@
"key": "block_v_padding",
"placeholder": {{verticalSpacingCombinedTr | json }}
},
{%- assign blockMaxWidthTr = "max_width" | lce -%}
{%- assign blockMaxWidthCombinedTr = blockMaxWidthTr | append: ' (%)' -%}
{
"title": '{{ blockMaxWidthCombinedTr | append: desktop-icon }}',
"type": "number",
"min": 1,
"key": "block_max_width",
"placeholder": {{ blockMaxWidthCombinedTr| json }}
},
{
"title": {{ "column_distribution" | lce | json }},
"title": '{{ "column_distribution" | lce | append: desktop-icon }}',
"type": "select",
"key": "block_justification",
"list": [
Expand All @@ -188,7 +188,7 @@
{%- assign pxTr = "units.px" | lce -%}
{%- assign colMaxWidthCombinedTr = colMaxWidthTr | append: ' (' | append: pxTr | append: ')' -%}
{
"title": {{ colMaxWidthCombinedTr | json }},
"title": '{{ colMaxWidthCombinedTr | append: desktop-icon }}',
"type": "number",
"min": 1,
"key": "col_max_width",
Expand All @@ -198,7 +198,7 @@
{%- assign pxTr = "units.px" | lce -%}
{%- assign colMinWidthCombinedTr = colMinWidthTr | append: ' (' | append: pxTr | append: ')' -%}
{
"title": {{ colMinWidthCombinedTr | json }},
"title": '{{ colMinWidthCombinedTr | append: desktop-icon }}',
"type": "number",
"min": 1,
"key": "col_min_width",
Expand All @@ -208,14 +208,14 @@
{%- assign pxTr = "units.px" | lce -%}
{%- assign colHPadCombinedTr = colHPadTr | append: ' (' | append: pxTr | append: ')' -%}
{
"title": {{ colHPadCombinedTr | json }},
"title": '{{ colHPadCombinedTr | append: desktop-icon }}',
"type": "number",
"min": 0,
"key": "col_h_padding",
"placeholder": {{ colHPadCombinedTr | json }}
},
{
"title": {{ "column_distribution" | lce | json }},
"title": '{{ "column_distribution" | lce | append: desktop-icon }}',
"type": "select",
"key": "col_justification",
"list": [
Expand Down
2 changes: 1 addition & 1 deletion components/settings-swiper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
},
{
"title": {{ "content_position" | lce | json }},
"title": '{{ "content_position" | lce | append: desktop-icon }}',
"type": "radio",
"key": "content_position",
"list": [
Expand Down
7 changes: 7 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
"layout_name": "ico-chevron-down",
"title": "ico-chevron-down"
},
{
"content_type": "component",
"component": true,
"file": "components/ico-desktop.tpl",
"layout_name": "ico-desktop",
"title": "ico-desktop"
},
{
"content_type": "component",
"component": true,
Expand Down