gd-sprest-bs 10.12.0 → 10.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -721,27 +721,43 @@ exports.ListForm.renderEditForm = function (props) {
721
721
  text: attachment.FileName,
722
722
  },
723
723
  options: {
724
- content: core_1.Components.Button({
725
- data: attachment,
726
- isSmall: true,
727
- text: "Remove",
728
- type: core_1.Components.ButtonTypes.Danger,
729
- onClick: function (btn, ev) {
730
- var attachment = btn.data;
731
- // Add this file for deletion
732
- attachments.delete.push(attachment);
733
- // Get the files
734
- var files = btnGroup.querySelectorAll(".btn.file-attachment");
735
- for (var i_1 = 0; i_1 < files.length; i_1++) {
736
- var file = files[i_1];
737
- // See if this is the target button
738
- if (file.innerText == attachment.FileName) {
739
- // Remove this popover
740
- file.parentElement.removeChild(file);
741
- break;
724
+ content: core_1.Components.ButtonGroup({
725
+ buttons: [
726
+ {
727
+ data: attachment,
728
+ isSmall: true,
729
+ text: "Remove",
730
+ type: core_1.Components.ButtonTypes.Danger,
731
+ onClick: function (btn, ev) {
732
+ var attachment = btn.data;
733
+ // Add this file for deletion
734
+ attachments.delete.push(attachment);
735
+ // Get the files
736
+ var files = btnGroup.querySelectorAll(".btn.file-attachment");
737
+ for (var i_1 = 0; i_1 < files.length; i_1++) {
738
+ var file = files[i_1];
739
+ // See if this is the target button
740
+ if (file.innerText == attachment.FileName) {
741
+ // Remove this popover
742
+ file.parentElement.removeChild(file);
743
+ break;
744
+ }
745
+ }
746
+ }
747
+ },
748
+ {
749
+ data: attachment,
750
+ isDisabled: attachment.ServerRelativeUrl ? false : true,
751
+ isSmall: true,
752
+ text: "View",
753
+ type: core_1.Components.ButtonTypes.Primary,
754
+ onClick: function (btn, ev) {
755
+ var fileUrl = btn.data.ServerRelativeUrl;
756
+ // Show the file in a new tab
757
+ window.open(fileUrl, "_blank");
742
758
  }
743
759
  }
744
- }
760
+ ]
745
761
  }).el
746
762
  }
747
763
  }).el);