Просмотр исходного кода

Ticket #3699 - Add reorder control in uploaders when reordering is enabled.

AntonLV 4 лет назад
Родитель
Сommit
1bae8405c2

+ 3 - 0
inc/js/classes/BxDolUploader.js

@@ -40,6 +40,7 @@ BxDolUploaderSimple.prototype.init = function (sUploaderObject, sStorageObject,
     this._sTemplateErrorGhosts = options.template_error_ghosts ? options.template_error_ghosts : this._sTemplateError;
 
     this._isMultiple = undefined == options.multiple || !options.multiple ? false : true;
+    this._isReordering = undefined == options.reordering || !options.reordering ? false : true;
 
     this._iContentId = undefined == options.content_id || '' == options.content_id ? '' : parseInt(options.content_id);
 
@@ -137,6 +138,8 @@ BxDolUploaderSimple.prototype.restoreGhosts = function (bInitReordering, onCompl
     var sUrl = this._getUrlWithStandardParams() + '&img_trans=' + this._sImagesTranscoder + '&a=restore_ghosts&f=json' + '&c=' + this._iContentId + '&_t=' + escape(new Date());
     var $this = this;
 
+    bInitReordering = bInitReordering !== undefined ? bInitReordering : this._isReordering;
+
     bx_loading(this._sResultContainerId, true);
 
     $.getJSON(sUrl, function (aData) {

+ 2 - 1
template/uploader_button_crop_js.html

@@ -4,6 +4,7 @@ __uploader_instance_name__ = new BxDolUploaderCrop('__engine__', '__storage_obje
     'images_transcoder' : '__images_transcoder__',
     'storage_private' : '__storage_private__',
     'template_error_msg': '<div class="bx-uploader-msg-err">{error}</div>',
-    'template_ghost': __template_ghost__
+    'template_ghost': __template_ghost__,
+    'reordering': __is_init_reordering__
 });
 <bx_if:restore_ghosts>__uploader_instance_name__.restoreGhosts(__is_init_reordering__);</bx_if:restore_ghosts>

+ 2 - 1
template/uploader_button_html5_js.html

@@ -4,6 +4,7 @@ __uploader_instance_name__ = new BxDolUploaderHTML5('__engine__', '__storage_obj
     'images_transcoder' : '__images_transcoder__',
     'storage_private' : '__storage_private__',
     'template_error_msg': '<div class="bx-uploader-msg-err">{error}</div>',
-    'template_ghost': __template_ghost__
+    'template_ghost': __template_ghost__,
+    'reordering': __is_init_reordering__
 });
 <bx_if:restore_ghosts>__uploader_instance_name__.restoreGhosts(__is_init_reordering__);</bx_if:restore_ghosts>

+ 2 - 1
template/uploader_button_record_video_js.html

@@ -5,7 +5,8 @@ __uploader_instance_name__ = new BxDolUploaderRecordVideo('__engine__', '__stora
     'storage_private' : '__storage_private__',
     'template_error_msg': '<div class="bx-uploader-msg-err">{error}</div>',
     'template_ghost': __template_ghost__,
+    'reordering': __is_init_reordering__,
     'audio_bitrate': __audio_bitrate__,
-    'video_bitrate': __video_bitrate__,
+    'video_bitrate': __video_bitrate__
 });
 <bx_if:restore_ghosts>__uploader_instance_name__.restoreGhosts(__is_init_reordering__);</bx_if:restore_ghosts>

+ 2 - 1
template/uploader_button_simple_js.html

@@ -4,6 +4,7 @@ __uploader_instance_name__ = new BxDolUploaderSimple('__engine__', '__storage_ob
     'images_transcoder' : '__images_transcoder__',
     'storage_private' : '__storage_private__',
     'template_error_msg': '<div class="bx-uploader-msg-err">{error}</div>',
-    'template_ghost': __template_ghost__
+    'template_ghost': __template_ghost__,
+    'reordering': __is_init_reordering__
 });
 <bx_if:restore_ghosts>__uploader_instance_name__.restoreGhosts(__is_init_reordering__);</bx_if:restore_ghosts>