Bladeren bron

Merge branch 'master' of https://code.bizgaze.com/dsaisudheer3772/BizgazeUI

# Conflicts:
#	assets/js/setting.js
Sai Sudheer 2 jaren geleden
bovenliggende
commit
c407874e58
1 gewijzigde bestanden met toevoegingen van 69 en 21 verwijderingen
  1. 69
    21
      assets/js/list.index.js

+ 69
- 21
assets/js/list.index.js Bestand weergeven

@@ -3,6 +3,7 @@ import {getCookie} from "./cookiehelper.js";
3 3
 
4 4
 import {getData, getDataObj} from "./base.js";
5 5
 import {_serverUrl} from "./setting.js";
6
+
6 7
 function createLoad(data) {
7 8
   let html = "";
8 9
   if (data.length != 0) {
@@ -26,77 +27,96 @@ function createLoad(data) {
26 27
     let pk_id = 0;
27 28
     const cookie = getCookie("_idty");
28 29
     let fomrhtml = "";
30
+    let width = iFrmeWdth();
29 31
     if (cookie) {
30 32
       const {unibaseId, tenantId, userId} = JSON.parse(cookie);
31
-      fomrhtml = `<div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}">
32
-                  <ul class="m-0 p-0">
33
-                    <li class="frm-hdr">
34
-                      <div>${appName}</div>
35
-                      <div class="ctrl">
36
-                        <a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
37
-                        <a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
38
-                        <a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
39
-                        <a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
33
+
34
+      fomrhtml = `<div>
35
+                    <div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}" style="right:${width}px">
36
+                      <div>
37
+                        <ul class="m-0 p-0">
38
+                          <li class="frm-hdr">
39
+                            <div class="app-title-ifrm">${appName}</div>
40
+                            <div class="ctrl">
41
+                              <a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
42
+                              <a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
43
+                              <a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
44
+                              <a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
45
+                            </div>
46
+                          </li>
47
+                          <li class="frm-bdy">
48
+                            <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
49
+                          </li>
50
+                          <li class="frm-ftr"></li>
51
+                        </ul>
40 52
                       </div>
41
-                    </li>
42
-                    <li class="frm-bdy">
43
-                      <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
44
-                    </li>
45
-                    <li class="frm-ftr"></li>
46
-                  </ul>
47
-                </div>`;
53
+                    </div>
54
+                  </div>`;
48 55
     }
49
-    $("#list-page").after(fomrhtml);
56
+    $("#list-page").append(fomrhtml);
50 57
     window.window.postMessage("ld-frm-ifrme", "*");
51 58
     hdrCrtnClckEvnt(number);
52 59
   });
53 60
 }
61
+
54 62
 function hdrCrtnClckEvnt(number) {
55 63
   $(`.frm-ifre-${number} .minimize`).on("click", function () {
56 64
     let id = $(this).attr("data-unid");
57 65
     let isPopUpState = $(this).attr("data-ispopup");
58 66
     let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
67
+    $(".list-page").css({filter: "unset", opacity: 1});
59 68
     $(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
60 69
     if (isPopUpState == "true") {
61 70
       // popup large
62 71
       $(this).attr("data-ispopup", "false");
72
+      $(`.frm-ifre-${id} .maximum`).addClass("d-none");
73
+      $(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
74
+      $(`.frm-ifre-${id}`).attr("data-ispop_up", "false");
63 75
       $(`.frm-ifre-${id}`).css({
64
-        width: "22%",
76
+        width: "20%",
65 77
         height: height,
66 78
         bottom: "0px",
67 79
       });
68 80
     } else {
69 81
       // popup small
70 82
       $(this).attr("data-ispopup", "true");
83
+      $(`.frm-ifre-${id} .maximum`).removeClass("d-none");
84
+      $(`.frm-ifre-${id}`).attr("data-ispop_up", "true");
71 85
       $(`.frm-ifre-${id}`).css({
72 86
         width: "",
73 87
         height: "",
74 88
         bottom: "",
75 89
       });
76 90
     }
91
+    resetwidth();
77 92
   });
78 93
   $(`.frm-ifre-${number} .maximum`).on("click", function () {
79 94
     let id = $(this).attr("data-unid");
80 95
     $(this).addClass("d-none");
81 96
     $(this).siblings(".compress").removeClass("d-none");
82 97
     $(`.frm-ifre-${id}`).find(".ld-frm-src").attr("data-ispopup", "true");
83
-    $(`.frm-ifre-${id}`).css({width: "75%", height: "", bottom: "auto"});
98
+    $(`.frm-ifre-${id}`).parent().addClass("wrap-iframe");
99
+    $(`.frm-ifre-${id}`).css({width: "75%", position: "unset"});
84 100
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: "100%"});
85 101
     $(`.frm-ifre-${id} .frm-bdy`).removeClass("d-none");
86 102
     $("#list-page").css({filter: "blur(2px)", opacity: "0.5"});
103
+    $(`.frm-ifre-${id}`).find(".minimize").toggleClass("d-none");
87 104
   });
88 105
   $(`.frm-ifre-${number} .compress`).on("click", function () {
89 106
     let id = $(this).attr("data-unid");
90 107
     $(this).addClass("d-none");
91 108
     $(this).siblings(".maximum").removeClass("d-none");
92
-    $(`.frm-ifre-${id}`).css({width: "", bottom: ""});
109
+    $(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
110
+    $(`.frm-ifre-${id}`).css({width: "", position: ""});
93 111
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: ""});
94 112
     $("#list-page").css({filter: "", opacity: ""});
113
+    $(`.frm-ifre-${id}`).find(".minimize").toggleClass("d-none");
95 114
   });
96 115
   $(`.frm-ifre-${number} .close`).on("click", function () {
97 116
     let id = $(this).attr("data-unid");
98 117
     $("#list-page").css({filter: "unset", opacity: "1"});
99
-    $(`.frm-ifre-${id}`).remove();
118
+    $(`.frm-ifre-${id}`).parent().remove();
119
+    resetwidth();
100 120
   });
101 121
 }
102 122
 function loadData() {
@@ -284,6 +304,34 @@ function loadData() {
284 304
     });
285 305
   });
286 306
 }
307
+function iFrmeWdth() {
308
+  let width = 0,
309
+    erwdth = 20;
310
+  $(".frm-ifre").each(function (i, e) {
311
+    if ($(this).length == 0) {
312
+      erwdth = 0;
313
+    }
314
+    if (window.innerWidth > width) {
315
+      width = width + $(this).width() + erwdth;
316
+    }
317
+  });
318
+  return width;
319
+}
320
+function resetwidth() {
321
+  let width = 0,
322
+    erwdth = 20;
323
+  $(".frm-ifre").each(function (i, e) {
324
+    if (i == 0) {
325
+      $(this).css("right", width + "px");
326
+    }
327
+    if (i != 0) {
328
+      $(this).css("right", width + "px");
329
+    }
330
+    if (window.innerWidth > width) {
331
+      width = width + $(this).width() + erwdth;
332
+    }
333
+  });
334
+}
287 335
 export function detailClick() {
288 336
   $(".detailBtn").click(function () {
289 337
     let serverUrl = _serverUrl();

Laden…
Annuleren
Opslaan