mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added fixed order in data attributes for signup form embed script
refs https://ghost.slack.com/archives/C04TMVA1D7A/p1685711310532969
This commit is contained in:
parent
8833ec03de
commit
ff28e1c94f
1 changed files with 16 additions and 1 deletions
|
@ -109,7 +109,22 @@ export default class SignupFormEmbedModal extends Component {
|
|||
}
|
||||
|
||||
let dataOptionsString = '';
|
||||
for (const [key, value] of Object.entries(options)) {
|
||||
const preferredOrder = [
|
||||
'background-color',
|
||||
'text-color',
|
||||
'button-color',
|
||||
'button-text-color',
|
||||
'title',
|
||||
'description',
|
||||
'logo',
|
||||
'site',
|
||||
'locale'
|
||||
];
|
||||
const sortedKeys = Object.keys(options).sort((a, b) => {
|
||||
return preferredOrder.indexOf(a) - preferredOrder.indexOf(b);
|
||||
});
|
||||
for (const key of sortedKeys) {
|
||||
const value = options[key];
|
||||
dataOptionsString += ` data-${key}="${escapeHtml(value)}"`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue