diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-07-15 02:02:09 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-07-19 02:21:36 +0300 |
commit | c7ffc71224dd8e1ce42372c9310bbcc937a00d2c (patch) | |
tree | 2f3e0d7360316d6392449997fc581c03e5efefcf /app/assets/javascripts | |
parent | ac828424646e14ec9d2032421c5ada91a8fd7dc9 (diff) |
Revert "Refactored .prev and .next methods"
This reverts commit ec37d9553274e3bca58e4de44b932cdc72a37325.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/files_comment_button.js.coffee | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/assets/javascripts/files_comment_button.js.coffee b/app/assets/javascripts/files_comment_button.js.coffee index db0bf7082a9..2b9dc6419d5 100644 --- a/app/assets/javascripts/files_comment_button.js.coffee +++ b/app/assets/javascripts/files_comment_button.js.coffee @@ -7,7 +7,6 @@ class @FilesCommentButton UNFOLDABLE_LINE_CLASS = 'js-unfold' EMPTY_CELL_CLASS = 'empty-cell' OLD_LINE_CLASS = 'old_line' - NEW_CLASS = 'new' LINE_COLUMN_CLASSES = ".#{LINE_NUMBER_CLASS}, .line_content" TEXT_FILE_SELECTOR = '.text-file' DEBOUNCE_TIMEOUT_DURATION = 100 @@ -64,20 +63,17 @@ class @FilesCommentButton getLineContent: (hoveredElement) -> return hoveredElement if hoveredElement.hasClass LINE_CONTENT_CLASS - $(".#{LINE_CONTENT_CLASS + @diffTypeClass hoveredElement}", hoveredElement.parent()) + $(hoveredElement).next ".#{LINE_CONTENT_CLASS}" getButtonParent: (hoveredElement) -> if @VIEW_TYPE is 'inline' return hoveredElement if hoveredElement.hasClass OLD_LINE_CLASS - $(".#{OLD_LINE_CLASS}", hoveredElement.parent()) + hoveredElement.parent().find ".#{OLD_LINE_CLASS}" else return hoveredElement if hoveredElement.hasClass LINE_NUMBER_CLASS - $(".#{LINE_NUMBER_CLASS + @diffTypeClass hoveredElement}", hoveredElement.parent()) - - diffTypeClass: (hoveredElement) -> - if hoveredElement.hasClass(NEW_CLASS) then '.new' else '.old' + $(hoveredElement).prev ".#{LINE_NUMBER_CLASS}" isMovingToSameType: (e) -> newButtonParent = @getButtonParent $(e.toElement) |