summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/templates/menu-edit.html
diff options
context:
space:
mode:
authorUdo Walter2018-11-23 16:02:17 +0100
committerUdo Walter2018-11-23 16:02:17 +0100
commit1729bd0ec9137697a7688c5f556163717abfb54b (patch)
tree474a58781a33bbd04c889944a37df56793420abc /modules-available/serversetup-bwlp/templates/menu-edit.html
parent[serversetup-bwlp] Fix adding boot entry of type exec (diff)
downloadslx-admin-1729bd0ec9137697a7688c5f556163717abfb54b.tar.gz
slx-admin-1729bd0ec9137697a7688c5f556163717abfb54b.tar.xz
slx-admin-1729bd0ec9137697a7688c5f556163717abfb54b.zip
[serversetup-bwlp] Fix new menu entries not using the preset titles
Diffstat (limited to 'modules-available/serversetup-bwlp/templates/menu-edit.html')
-rw-r--r--modules-available/serversetup-bwlp/templates/menu-edit.html22
1 files changed, 16 insertions, 6 deletions
diff --git a/modules-available/serversetup-bwlp/templates/menu-edit.html b/modules-available/serversetup-bwlp/templates/menu-edit.html
index 6059333e..2141103f 100644
--- a/modules-available/serversetup-bwlp/templates/menu-edit.html
+++ b/modules-available/serversetup-bwlp/templates/menu-edit.html
@@ -84,7 +84,7 @@
<td class="text-nowrap">
<input class="entry-id" type="hidden" name="entry[{{menuentryid}}][entryid]" value="{{entryid}}">
- <button type="button" class="btn btn-default" style="width: 100%; text-align: left" {{disabled}} data-toggle="modal" data-target="#entry-chosser-modal">
+ <button type="button" class="btn btn-default" style="width: 100%; text-align: left" {{disabled}} data-toggle="modal" data-target="#entry-chooser-modal">
{{#entryid}}
{{entryid}}
{{/entryid}}
@@ -136,7 +136,7 @@
</div>
</form>
- <div class="modal fade" id="entry-chosser-modal" tabindex="-1" role="dialog">
+ <div class="modal fade" id="entry-chooser-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -259,7 +259,7 @@
<td class="text-nowrap">
<input class="entry-id" type="hidden" name="entry[%new%][entryid]" value="">
- <button type="button" class="btn btn-default" style="width: 100%; text-align: left" {{disabled}} data-toggle="modal" data-target="#entry-chosser-modal">
+ <button type="button" class="btn btn-default" style="width: 100%; text-align: left" {{disabled}} data-toggle="modal" data-target="#entry-chooser-modal">
{{lang_spacer}}
</button>
</td>
@@ -363,21 +363,21 @@
});
$('#entry-list').change(function(e) {
- var modal = $('#entry-chosser-modal');
+ var modal = $('#entry-chooser-modal');
modal.find('.entrydata').hide();
modal.find('#entrydata-' + $(this).val()).show();
});
var currentEntryButton = null;
- $('#entry-chosser-modal').on('show.bs.modal', function(e) {
+ $('#entry-chooser-modal').on('show.bs.modal', function(e) {
currentEntryButton = $(e.relatedTarget);
var entryId = currentEntryButton.parent().find('.entry-id').val();
$('#entry-list').val(entryId).change();
});
$('#choose-entry').click(function() {
- $('#entry-chosser-modal').modal('hide');
+ $('#entry-chooser-modal').modal('hide');
var entryId = $('#entry-list').val();
currentEntryButton.parent().find('.entry-id').val(entryId);
currentEntryButton.text(entryId || spacerText);
@@ -390,6 +390,16 @@
} else {
tableRow.find('.no-spacer').show();
}
+ var $title = tableRow.find('.title');
+ var oldval = $title.data('old');
+ if (oldval === '#stop#')
+ return;
+ if (oldval !== '#new#' && oldval !== $title.val()) {
+ $title.data('old', '#stop#');
+ return;
+ }
+ var text = $('#' + entryId + '-name').text();
+ $title.val(text).data('old', text);
});
});
</script> \ No newline at end of file