mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
Fix new task canvas position [SCI-7694]
This commit is contained in:
parent
631608e7db
commit
a8f6076b73
1 changed files with 2 additions and 2 deletions
|
@ -36,8 +36,8 @@ class MyModulesController < ApplicationController
|
|||
|
||||
def create
|
||||
max_xy = @experiment.my_modules.select('MAX("my_modules"."x") AS x, MAX("my_modules"."y") AS y').take
|
||||
x = max_xy.x ? (max_xy.x + 10) : 1
|
||||
y = max_xy.y ? (max_xy.y + 10) : 1
|
||||
x = max_xy.x ? (max_xy.x + 14) : 1
|
||||
y = max_xy.y ? (max_xy.y + 14) : 1
|
||||
@my_module = @experiment.my_modules.new(my_module_params)
|
||||
@my_module.assign_attributes(created_by: current_user, last_modified_by: current_user, x: x, y: y)
|
||||
@my_module.transaction do
|
||||
|
|
Loading…
Reference in a new issue