فهرست منبع

Fixed unset method used for delete a previewCache index

We have to clean the tags array too.
There is a problem when we upload a file, delete the file, and upload another file, the tags are the same than the first file uploaded. Only occurs when we have custom layoutTemplates and previewThumbTags.
rapomon 10 سال پیش
والد
کامیت
c85bc76058
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      js/fileinput.js

+ 3 - 1
js/fileinput.js

@@ -204,10 +204,12 @@
             if (chk === 1) {
                 previewCache.data[id].content = [];
                 previewCache.data[id].config = [];
+                previewCache.data[id].tags = [];
                 return;
             }
             previewCache.data[id].content[index] = null;
             previewCache.data[id].config[index] = null;
+            previewCache.data[id].tags[index] = null;
         },
         out: function (id) {
             var html = '', data = previewCache.data[id], caption, len = previewCache.count(id, true);
@@ -2761,4 +2763,4 @@
             $input.fileinput();
         }
     });
-}));
+}));