move up down fixes
This commit is contained in:
@ -7,19 +7,19 @@ module Merged
|
||||
fields :id , :index , :section_id
|
||||
fields :text , :header, :image_name
|
||||
|
||||
def move_up
|
||||
swap_index_with(next_card)
|
||||
end
|
||||
|
||||
def change_name
|
||||
pagename = section ? section.page.name : section_id.to_s
|
||||
"#{pagename}:#{header}"
|
||||
end
|
||||
|
||||
def move_down
|
||||
def move_up
|
||||
swap_index_with(previous_card)
|
||||
end
|
||||
|
||||
def move_down
|
||||
swap_index_with(next_card)
|
||||
end
|
||||
|
||||
def previous_card
|
||||
section.cards.where(index: index - 1).first
|
||||
end
|
||||
|
@ -42,11 +42,11 @@ module Merged
|
||||
end
|
||||
|
||||
def move_up
|
||||
swap_index_with(next_section)
|
||||
swap_index_with(previous_section)
|
||||
end
|
||||
|
||||
def move_down
|
||||
swap_index_with(previous_section)
|
||||
swap_index_with(next_section)
|
||||
end
|
||||
|
||||
def previous_section
|
||||
|
Reference in New Issue
Block a user