diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /lib/gitlab/relative_positioning | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'lib/gitlab/relative_positioning')
-rw-r--r-- | lib/gitlab/relative_positioning/item_context.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/relative_positioning/item_context.rb b/lib/gitlab/relative_positioning/item_context.rb index 8f5495ece5e..1e738aef9b0 100644 --- a/lib/gitlab/relative_positioning/item_context.rb +++ b/lib/gitlab/relative_positioning/item_context.rb @@ -129,6 +129,14 @@ module Gitlab neighbour(sib) end + def at_position(position) + item = scoped_items.find_by(relative_position: position) + + raise InvalidPosition, 'No item found at the specified position' if item.nil? + + neighbour(item) + end + def shift_left move_sequence_before(true) object.reset_relative_position |