mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
Fix infinite update for image annotation (#1889)
This commit is contained in:
parent
d147e8260d
commit
09dacf3be2
1 changed files with 7 additions and 1 deletions
|
@ -11,6 +11,7 @@ class AssetsController < ApplicationController
|
|||
include ApplicationHelper
|
||||
include InputSanitizeHelper
|
||||
include FileIconsHelper
|
||||
include MyModulesHelper
|
||||
|
||||
before_action :load_vars, except: :create_wopi_file
|
||||
before_action :check_read_permission, except: :file_present
|
||||
|
@ -177,6 +178,9 @@ class AssetsController < ApplicationController
|
|||
@asset.step&.protocol&.update(updated_at: Time.now)
|
||||
|
||||
render_html = if @asset.step
|
||||
assets = @asset.step.assets
|
||||
order_atoz = az_ordered_assets_index(assets, @asset.id)
|
||||
order_ztoa = assets.length - az_ordered_assets_index(assets, @asset.id)
|
||||
asset_position = @asset.step.asset_position(@asset)
|
||||
render_to_string(
|
||||
partial: 'steps/attachments/item.html.erb',
|
||||
|
@ -184,7 +188,9 @@ class AssetsController < ApplicationController
|
|||
asset: @asset,
|
||||
i: asset_position[:pos],
|
||||
assets_count: asset_position[:count],
|
||||
step: @asset.step
|
||||
step: @asset.step,
|
||||
order_atoz: order_atoz,
|
||||
order_ztoa: order_ztoa
|
||||
},
|
||||
formats: :html
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue