diff --git a/public/assets/scripts/dash/app/ui/FileManager.js b/public/assets/scripts/dash/app/ui/FileManager.js index a88904c..08628bd 100644 --- a/public/assets/scripts/dash/app/ui/FileManager.js +++ b/public/assets/scripts/dash/app/ui/FileManager.js @@ -64,23 +64,13 @@ export default class FileManager { getFileOrder() { let imgList = ''; let fileList = ''; - //change file order this and chance data-source to data-id - //console.log('ORDER', this.mediaSort.toArray()); - for (var i = 0, length = this.imageList.childNodes.length; i < length; i++) { - try { - let div = this.imageList.childNodes[i]; - imgList = imgList + div.getAttribute('data-source') + ','; - } catch (e) { - //something is function - } + let mediaArray = this.mediaSort.toArray(); + let fileArray = this.fileSort.toArray(); + for (var i = 0, length = mediaArray.length; i < length; i++) { + imgList = imgList + mediaArray[i] + ','; } - for (var i = 0, length = this.fileList.childNodes.length; i < length; i++) { - try { - let div = this.fileList.childNodes[i]; - fileList = fileList + div.getAttribute('data-source') + ','; - } catch (e) { - //something is function - } + for (var i = 0, length = fileArray.length; i < length; i++) { + fileList = fileList + fileArray[i] + ','; } let media = { images: imgList, files: fileList }; return media; diff --git a/resources/views/back/page.blade.php b/resources/views/back/page.blade.php index 92fcc59..5965cd2 100644 --- a/resources/views/back/page.blade.php +++ b/resources/views/back/page.blade.php @@ -50,7 +50,7 @@ @if(count($media)>1) @foreach($media as $item) @if($item['type'] == "mp4") -
+
@@ -59,7 +59,7 @@
@else -
+
@@ -67,14 +67,14 @@ @endif @endforeach @else - @if(media[0] != '') - @if(media[0]['type'] == "mp4") -
- + @if($media[0] != '') + @if($media[0]['type'] == "mp4") +
+
@else -
-
@@ -90,7 +90,7 @@ $fileName = explode("/", $item['file']); @endphp @if($item['type'] == "mp3") -
+
@@ -99,7 +99,7 @@
@else -
+
{{ $fileName[6] }}"
@else -