zet-lib 1.4.21 → 1.4.23

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.
package/lib/moduleLib.js CHANGED
@@ -569,7 +569,8 @@ m.dropboxview = (req, res) => {
569
569
  let head = ``;
570
570
  let end = ``;
571
571
  script +=
572
- `$(()=>{
572
+ `let dropbox_image = {}
573
+ $(()=>{
573
574
  $(".zdropbox-view").each(function (index, item) {
574
575
  let dropboxLength = $(".zdropbox-view").length || 0;
575
576
  ajaxPost('/zdropbox-file/' + index, {
@@ -577,6 +578,7 @@ m.dropboxview = (req, res) => {
577
578
  table: $(this).attr('data-table'),
578
579
  field: $(this).attr('data-field'),
579
580
  }, function (result) {
581
+ dropbox_image[result.name] = result.link;
580
582
  $(item).attr("src", result.link)
581
583
  $(item).attr('data-link', result.link);
582
584
  if (+result.index == (+dropboxLength - 1)) {
@@ -602,7 +604,18 @@ function modaldropbox() {
602
604
  })
603
605
  }
604
606
  })
605
- }` + newLine;
607
+ setTimeout(() => {
608
+ $("img").each(function(){
609
+ if($(this).attr("src") == "/img/dropbox.png") {
610
+ let name = $(this).attr("data-name");
611
+ if(dropbox_image[name]) {
612
+ $(this).attr("src",dropbox_image[name]);
613
+ }
614
+ }
615
+ })
616
+ },3000)
617
+ }
618
+ ` + newLine;
606
619
 
607
620
  return {
608
621
  head: head,
package/lib/zRoute.js CHANGED
@@ -4335,7 +4335,7 @@ zRoute.generateJS = (req, res, MYMODEL, relations, zForms = "", data = {}) => {
4335
4335
  });
4336
4336
  if(dropbox_${item}_data.length > 0) {
4337
4337
  ajaxPost('/zdropbox-files',{files:dropbox_${item}_data,table:"${MYMODEL.table}",field:"${item}"}, function(datas) {
4338
- datas.map((mockFile) => {
4338
+ datas.map((mockFile, index) => {
4339
4339
  dz.options.addedfile.call(dz, mockFile);
4340
4340
  dz.options.thumbnail.call(dz, mockFile, mockFile.link);
4341
4341
  const imageElement = mockFile.previewElement.querySelector('.dz-image');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.4.21",
3
+ "version": "1.4.23",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"