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-04-21 00:09:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-21 00:09:07 +0300
commit98f1353fcd07e45ef995c3cee14b659711a63221 (patch)
tree6b699245b77a76a754d86a343af261560f3bb2d0 /lib/gitlab/relative_positioning
parentb6e611dd423708f2e31c034e5dcab9b0cd18021a (diff)
Add latest changes from gitlab-org/gitlab@master
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