From b702b7dbc3e483455c3dd6683276f8b379786e49 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 12 Jul 2022 10:53:45 +1000 Subject: [PATCH] fix(developer): fix issues with template and presentation --- developer/src/tike/child/UfrmKeymanWizard.pas | 1 + developer/src/tike/xml/layoutbuilder/builder.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/developer/src/tike/child/UfrmKeymanWizard.pas b/developer/src/tike/child/UfrmKeymanWizard.pas index 859692b8339..c7d81d5fc18 100644 --- a/developer/src/tike/child/UfrmKeymanWizard.pas +++ b/developer/src/tike/child/UfrmKeymanWizard.pas @@ -3323,6 +3323,7 @@ procedure TfrmKeymanWizard.SelectTouchLayoutTemplate(APromptChange: Boolean); PromptChange := APromptChange; if ShowModal = mrOk then begin + frameTouchLayout.SaveToString; frameTouchLayout.TemplateFileName := TemplateFileName; frameTouchLayout.Load('', True, False); // I4034 Self.Modified := True; diff --git a/developer/src/tike/xml/layoutbuilder/builder.js b/developer/src/tike/xml/layoutbuilder/builder.js index 81917c2ae38..cee6a15b385 100644 --- a/developer/src/tike/xml/layoutbuilder/builder.js +++ b/developer/src/tike/xml/layoutbuilder/builder.js @@ -954,10 +954,15 @@ $(function() { $('#selPlatform').val(data.platform); } builder.selectPlatform(); - if(data.presentation && builder.presentations[data.presentation]) { + if(data.presentation && + builder.presentations[data.presentation] && + $('#selPlatformPresentation option[value="'+data.presentation+'"]').length) { $('#selPlatformPresentation').val(data.presentation); - builder.prepareLayer(); + } else { + // The last selected presentation is no longer available; select the first option instead + $('#selPlatformPresentation').val($('#selPlatformPresentation option:first').val()); } + builder.prepareLayer(); if(data.layer && KVKL[builder.lastPlatform][data.layer]) { $('#selLayer').val(data.layer); builder.selectLayer();