diff options
author | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-01-29 02:26:47 +0300 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-01-29 02:26:47 +0300 |
commit | 9c2bd8b70eedc9969f5ba4c7fc1a7d96369e1438 (patch) | |
tree | 94aad324b952cf568e655e94755a5ff016f9959e /app/helpers/application_helper.rb | |
parent | 0b030e00a15f849a5cbb2778a6b88c57a2e43d4b (diff) |
Sidebar collapse and expand work with whole page.
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b0cd984024f..00f38932861 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -307,9 +307,19 @@ module ApplicationHelper if project.nil? nil elsif current_controller?(:issues) - project.issues.where("id > ?", id).first + project.issues.where("id > ?", id).last elsif current_controller?(:merge_requests) - project.merge_requests.where("id > ?", id).first + project.merge_requests.where("id > ?", id).last + end + end + + def has_next_issuable?(project, id) + if project.nil? + nil + elsif current_controller?(:issues) + project.issues.where("id > ?", id).last + elsif current_controller?(:merge_requests) + project.merge_requests.where("id > ?", id).last end end @@ -317,9 +327,19 @@ module ApplicationHelper if project.nil? nil elsif current_controller?(:issues) - project.issues.where("id < ?", id).last + project.issues.where("id < ?", id).first + elsif current_controller?(:merge_requests) + project.merge_requests.where("id < ?", id).first + end + end + + def has_prev_issuable?(project, id) + if project.nil? + nil + elsif current_controller?(:issues) + project.issues.where("id < ?", id).first elsif current_controller?(:merge_requests) - project.merge_requests.where("id < ?", id).last + project.merge_requests.where("id < ?", id).first end end |