Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

itemscarousel.js 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Transact;
  6. (function (Transact) {
  7. let Controls;
  8. (function (Controls) {
  9. let ItemDetails;
  10. (function (ItemDetails) {
  11. class ItemsCarousel extends Unibase.Platform.Core.BaseComponent {
  12. constructor() {
  13. super(...arguments);
  14. this.appsHtml = '';
  15. this.IsAppRefresh = false;
  16. }
  17. jsFiles() {
  18. return ['apps/transact/controls/itemdetails/itemscarousel.js'];
  19. }
  20. cssFiles() {
  21. return [];
  22. }
  23. html(id, containerid) {
  24. var instance = this;
  25. let html = ` <div id="img-modal" class="modal-content h-100">
  26. <div class="modal-header pa-10"> <strong class="modal-title biz-highlight-bg-color" id="imagegalleryheading">Items</strong>
  27. <div class="d-flex align-items-center justify-content-between">
  28. <div> </div>
  29. </div>
  30. <div id="divEditFiltersErrMsg" class="form-error-message"></div>
  31. </div>
  32. <div class="modal-body simple-scroll-bar edit-filters-body py-0 bg-cyan-light-5">
  33. <div class="d-flex" id="galleryheightmodel" style="gap: 10px;align-items: center;height:80vh">
  34. <a style="opacity: 1; width:20px; " class="carousel-control-prev position-static" href="#carouselExampleControls" role="button"
  35. data-slide="prev"> <span style="background-image: none;" class="carousel-control-prev-icon"
  36. aria-hidden="true"> <i class="fa fa-angle-double-left " style=" color: black; font-size: 34px; "></i>
  37. </span> <span class="preImgHandler sr-only">Previous</span> </a>
  38. <div class="card bg-transparent border-0 shadow-none" id="staticFiltersCard" style="
  39. flex-grow: 1;
  40. ">
  41. <div id="carouselExampleControls" data-interval="2000" class="carousel slide-fade" data-ride="carousel">
  42. <div class="carousel-inner" style="padding:10px "> </div>
  43. </div>
  44. </div>
  45. <a style="opacity: 1;width: 20px;" class="carousel-control-next position-static" href="#carouselExampleControls" role="button"
  46. data-slide="next"> <span style="background-image: none;" class="carousel-control-next-icon"
  47. aria-hidden="true"> <i class="fa fa-angle-double-right" style=" color: black; font-size: 34px;"></i>
  48. </span> <span class="sr-only ">Next</span> </a>
  49. </div>
  50. </div>
  51. <div class="modal-footer pa-10"> <button type="button"
  52. onclick="Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp()" id="btn_CloseForm_${id}"
  53. class="btn btn-light btn-sm mr-auto">Close</button>
  54. </div>
  55. </div>`;
  56. return html;
  57. }
  58. load(id, containerid, callback) {
  59. var instance = this;
  60. instance.carouselModel(id);
  61. $('.carousel').carousel({
  62. interval: 2000,
  63. wrap: false,
  64. });
  65. }
  66. carouselModel(id) {
  67. var instance = this;
  68. instance.fileCacheHelper.loadJsFile("platform/files/managers/filemanager.js", function () {
  69. Unibase.Platform.Files.Managers.FileManager.Instance().getDocumentByRefIdApi(id).then(function (response) {
  70. var document = response.result.sort().reverse();
  71. var documentfiles = response.result.map(x => x.DocumentFiles);
  72. let html = '';
  73. for (let i = 0; i < documentfiles.length; i++) {
  74. if (documentfiles[i].length > 0) {
  75. let DocumentFilePath = documentfiles[i][0].DocumentFilePath;
  76. if (i == 0) {
  77. html = `<div style = "max-height: 100vh !important" class="carousel-item active" >
  78. <img class="mh-100 mw-100 w-100" src = "${DocumentFilePath}" alt = "image not found" onerror = "ReloadImage(event)" data-dynamic="1" data-loaded="0"></div>`;
  79. }
  80. else {
  81. html = `<div style = "max-height: 100vh !important" class="carousel-item" >
  82. <img class="mh-100 mw-100 w-100" src="${DocumentFilePath}" alt="image not found" onerror = "ReloadImage(event)" data-dynamic="1" data-loaded="0"></div>`;
  83. }
  84. $(".carousel-inner").append(html);
  85. if (i == documentfiles.length - 1) {
  86. return;
  87. }
  88. ;
  89. }
  90. }
  91. });
  92. });
  93. }
  94. static Instance() {
  95. if (this._instance === undefined)
  96. this._instance = new ItemsCarousel();
  97. return this._instance;
  98. }
  99. }
  100. ItemDetails.ItemsCarousel = ItemsCarousel;
  101. })(ItemDetails = Controls.ItemDetails || (Controls.ItemDetails = {}));
  102. })(Controls = Transact.Controls || (Transact.Controls = {}));
  103. })(Transact = Apps.Transact || (Apps.Transact = {}));
  104. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  105. })(Bizgaze || (Bizgaze = {}));