Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /lib/gitlab/relative_positioning
parente570267f2f6b326480d284e0164a6464ba4081bc (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.rb8
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