Apply palettes to shared layouts and template pages

This commit is contained in:
2026-11-28 12:37:25 +08:00
parent 1aaf3908af
commit 70a94dd394
15 changed files with 104 additions and 27 deletions
+3 -1
View File
@@ -1375,7 +1375,9 @@ jQuery(function ($) {
});
pageInput('palette_id').on('change.canvas', function () {
$doc.find('[data-page-palette]').remove();
const href = this.selectedOptions[0]?.dataset.paletteCss;
const option = this.selectedOptions[0];
const href = option?.dataset.paletteCss;
$doc.find('#main-content').attr('data-region-palette', option?.hasAttribute('data-palette-region') ? option.value : null);
if (href) {
$('<link>', {rel: 'stylesheet', href, 'data-page-palette': ''})
.one('load', syncFormatControls).appendTo($doc.find('head'));