Apply palettes to shared layouts and template pages
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user