forked from laysense/laysite
Prepare LaySite 1.5.1 page routing and template updates
This commit is contained in:
@@ -682,6 +682,10 @@ jQuery(function ($) {
|
||||
}
|
||||
|
||||
$settings.on('studio:saved', (_event, saved, submitter) => {
|
||||
if (saved?.saved && saved.redirect) {
|
||||
$(window).off('beforeunload.studioPage');
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(saved?.sections)) return;
|
||||
const versions = new Map(saved.sections.map((section) => [section.key, section]));
|
||||
const dynamic = [];
|
||||
@@ -747,7 +751,7 @@ jQuery(function ($) {
|
||||
$layout.prop('inert', busy);
|
||||
$settings.prop('inert', busy);
|
||||
});
|
||||
$(window).on('beforeunload', (event) => {
|
||||
$(window).on('beforeunload.studioPage', (event) => {
|
||||
if (sectionChanges(false).length || pageInput('provider_secret').filter(':enabled').val()
|
||||
|| initialOrder !== undefined && canvasOrder() !== initialOrder
|
||||
|| JSON.stringify(settingsSnapshot(true)) !== savedSettings) {
|
||||
@@ -1368,8 +1372,9 @@ jQuery(function ($) {
|
||||
});
|
||||
pageInput('palette_id').on('change.canvas', function () {
|
||||
$doc.find('[data-page-palette]').remove();
|
||||
if (this.value) {
|
||||
$('<link>', {rel: 'stylesheet', href: '/palette/' + this.value + '.css', 'data-page-palette': ''})
|
||||
const href = this.selectedOptions[0]?.dataset.paletteCss;
|
||||
if (href) {
|
||||
$('<link>', {rel: 'stylesheet', href, 'data-page-palette': ''})
|
||||
.one('load', syncFormatControls).appendTo($doc.find('head'));
|
||||
} else syncFormatControls();
|
||||
pageInput('palette_id').trigger('change.palettePicker');
|
||||
|
||||
Reference in New Issue
Block a user