]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6057 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Jun 2023 05:44:24 +0000 (07:44 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Jun 2023 05:44:24 +0000 (07:44 +0200)
resources/views/fields/fluidbook_chapters.blade.php

index b1bcbd4e35738e03f3f425d2bedcc8ced3f1ed33..ad211c0653733128579b4b423e5e3b3ac0de2dac 100644 (file)
@@ -7,6 +7,11 @@
                 $(document).trigger('fluidbook_chapters.level.change');
                 $(document).on('click', '.chaptersExportExcel', function () {
                     var json = $(this).closest('.bunchmultiple[data-values]').find('.hiddenfield').eq(0).val();
+
+                    if (json == undefined || json == null || json == '' || json == '[]') {
+                        json = '[{"label":"Label","page":"2","color":"","decoration":"regular","level":"0"}]';
+                    }
+
                     var form = $('<form action="{{backpack_url('tools/dojson2excel')}}" method="post">' +
                             '<input type="hidden" name="json" value="" />' +
                             '<input type="hidden" name="filename" value="chapters_{{$entry->id}}" />' +
@@ -17,7 +22,7 @@
                     $('body').append(form);
                     $(form).find('input[name="json"]').val(json);
                     $(form).find('input[name="name"]').val('chapters_' + $('input[name="id"]').val());
-                    form.submit();
+                     form.submit();
                     return false;
                 });
                 $(document).on('click', '.chaptersImportExcel', function () {