Skip to content

Commit

Permalink
Merge pull request #11759 from keymanapp/fix/developer/11646-add-plat…
Browse files Browse the repository at this point in the history
…form-no-more-platforms-builder

fix(developer): show message if no more platforms to add to touch layout editor
  • Loading branch information
mcdurdin authored Jun 13, 2024
2 parents edd42d1 + 074c8f7 commit 4a35e51
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions developer/src/tike/xml/layoutbuilder/builder.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@
</form>
</div>

<div id='addPlatformDialogNoPlatformsToAdd' title='Add platform'>
<p>All available platforms have already been added.</p>
</div>

<div id='addLayerDialog' title='Add layer'>
<form>
<fieldset>
Expand Down
24 changes: 23 additions & 1 deletion developer/src/tike/xml/layoutbuilder/platform-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ $(function() {
for (var platform in KVKL) {
platforms[platform] = 0;
}
let nPlatforms = 0;
for (platform in platforms) {
if (platforms[platform]) {
var opt = document.createElement('option');
$(opt).text(platform);
$('#selAddPlatform').append(opt);
nPlatforms++;
}
}
$('#addPlatformDialog').dialog('open')
if(nPlatforms == 0) {
$('#addPlatformDialogNoPlatformsToAdd').dialog('open')
} else {
$('#addPlatformDialog').dialog('open')
}
});

$('#btnDelPlatform').click(function () {
Expand Down Expand Up @@ -69,6 +75,22 @@ $(function() {
}
});

//
// Platform dialog -- no platforms to add
//

$('#addPlatformDialogNoPlatformsToAdd').dialog({
autoOpen: false,
height: 150,
width: 350,
modal: true,
buttons: {
"OK": function () {
$(this).dialog('close');
}
}
});

//
// Platform Properties Dialog
//
Expand Down

0 comments on commit 4a35e51

Please sign in to comment.