Skip to content

Commit 9461555

Browse files
authored
Fix: Add missing subtitle text alignment option (fix #555)
1 parent 36acb5e commit 9461555

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"_pageHeader": {
3131
"_textAlignment": {
3232
"_title": "",
33+
"_subtitle": "",
3334
"_body": "",
3435
"_instruction": ""
3536
},

js/themePageView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class ThemePageView extends ThemeView {
2525
if (!textAlignment) return;
2626

2727
if (textAlignment._title) this.$el.addClass(`title-align-${textAlignment._title}`);
28+
if (textAlignment._subtitle) this.$el.addClass(`subtitle-align-${textAlignment._subtitle}`);
2829
if (textAlignment._body) this.$el.addClass(`body-align-${textAlignment._body}`);
2930
if (textAlignment._instruction) this.$el.addClass(`instruction-align-${textAlignment._instruction}`);
3031
}

js/themeView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default class ThemeView extends Backbone.View {
4343
if (!textAlignment) return;
4444

4545
if (textAlignment._title) this.$el.addClass(`title-align-${textAlignment._title}`);
46+
if (textAlignment._subtitle) this.$el.addClass(`subtitle-align-${textAlignment._subtitle}`);
4647
if (textAlignment._body) this.$el.addClass(`body-align-${textAlignment._body}`);
4748
if (textAlignment._instruction) this.$el.addClass(`instruction-align-${textAlignment._instruction}`);
4849
}

less/project/theme-common.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,21 @@
9292

9393
.@{selector} {
9494
&.title-align-left &__title,
95+
&.subtitle-align-left &__subtitle,
9596
&.body-align-left &__body,
9697
&.instruction-align-left &__instruction {
9798
text-align: start;
9899
}
99100

100101
&.title-align-center &__title,
102+
&.subtitle-align-center &__subtitle,
101103
&.body-align-center &__body,
102104
&.instruction-align-center &__instruction {
103105
text-align: center;
104106
}
105107

106108
&.title-align-right &__title,
109+
&.subtitle-align-right &__subtitle,
107110
&.body-align-right &__body,
108111
&.instruction-align-right &__instruction {
109112
text-align: end;

properties.schema

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,14 @@
12741274
"title": "Title alignment",
12751275
"help": "Set the alignment of the page title. Left: Aligns the title to the left of the container. Center: Aligns the title to the center of the container. Right: Aligns the title to the right of the container. The alignment automatically inverses for right-to-left languages. The default is `` which inherits the natural page direction."
12761276
},
1277+
"_subtitle": {
1278+
"type": "string",
1279+
"required": false,
1280+
"default": "",
1281+
"inputType": {"type":"Select", "options":["","left","center","right"]},
1282+
"title": "Subtitle alignment",
1283+
"help": "Set the alignment of the page subtitle. Left: Aligns the subtitle to the left of the container. Center: Aligns the subtitle to the center of the container. Right: Aligns the subtitle to the right of the container. The alignment automatically inverses for right-to-left languages. The default is `` which inherits the natural page direction."
1284+
},
12771285
"_body": {
12781286
"type": "string",
12791287
"required": false,

schema/contentobject.schema.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,19 @@
161161
],
162162
"_backboneForms": "Select"
163163
},
164+
"_subtitle": {
165+
"type": "string",
166+
"title": "Subtitle alignment",
167+
"description": "Set the alignment of the page subtitle. Left: Aligns the subtitle to the left of the container. Center: Aligns the subtitle to the center of the container. Right: Aligns the subtitle to the right of the container. The alignment automatically inverses for right-to-left languages. The default is `` which inherits the natural page direction.",
168+
"default": "",
169+
"enum": [
170+
"",
171+
"left",
172+
"center",
173+
"right"
174+
],
175+
"_backboneForms": "Select"
176+
},
164177
"_body": {
165178
"type": "string",
166179
"title": "Body alignment",

0 commit comments

Comments
 (0)