uploads: autorefresh thumbnails on multi-file uploads page.
Automatically refresh thumbnails on the multi-file upload page as images are processed in the background.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
class MediaAssetPreviewComponent < ApplicationComponent
|
||||
DEFAULT_SIZE = 180
|
||||
|
||||
attr_reader :media_asset, :size, :link_target, :classes, :save_data
|
||||
attr_reader :media_asset, :size, :link_target, :classes, :html, :save_data
|
||||
delegate :duration_to_hhmmss, :sound_icon, to: :helpers
|
||||
|
||||
renders_one :header
|
||||
@@ -17,12 +17,13 @@ class MediaAssetPreviewComponent < ApplicationComponent
|
||||
# @param link_target [ApplicationRecord] What the thumbnail links to (default: the media asset).
|
||||
# @param save_data [Boolean] If true, save data by not serving higher quality thumbnails
|
||||
# on 2x pixel density displays. Default: false.
|
||||
def initialize(media_asset:, size: DEFAULT_SIZE, link_target: media_asset, classes: [], save_data: CurrentUser.save_data)
|
||||
def initialize(media_asset:, size: DEFAULT_SIZE, link_target: media_asset, classes: [], html: {}, save_data: CurrentUser.save_data)
|
||||
super
|
||||
@media_asset = media_asset
|
||||
@size = size.presence&.to_i || DEFAULT_SIZE
|
||||
@link_target = link_target
|
||||
@classes = classes
|
||||
@html = html
|
||||
@save_data = save_data
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user