Commit d925aea9 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

flattened button attributes obj set to build comment button

parent 5ab95ba6
...@@ -40,16 +40,13 @@ class @FilesCommentButton ...@@ -40,16 +40,13 @@ class @FilesCommentButton
return unless @shouldRender e, buttonParentElement return unless @shouldRender e, buttonParentElement
buttonParentElement.append @buildButton buttonParentElement.append @buildButton
id: commit_id: textFileElement.attr 'data-commit-id'
noteable: textFileElement.attr 'data-noteable-id' discussion_id: lineContentElement.attr('data-discussion-id') or lineHolderElement.attr('data-discussion-id')
commit: textFileElement.attr 'data-commit-id' line_code: lineContentElement.attr('data-line-code') or lineHolderElement.attr('id')
discussion: lineContentElement.attr('data-discussion-id') or lineHolderElement.attr('data-discussion-id') line_type: lineContentElement.attr 'data-line-type'
type: note_type: textFileElement.attr 'data-note-type'
noteable: textFileElement.attr 'data-noteable-type' noteable_id: textFileElement.attr 'data-noteable-id'
note: textFileElement.attr 'data-note-type' noteable_type: textFileElement.attr 'data-noteable-type'
line: lineContentElement.attr 'data-line-type'
code:
line: lineContentElement.attr('data-line-code') or lineHolderElement.attr('id')
return return
destroy: (e) => destroy: (e) =>
...@@ -61,13 +58,13 @@ class @FilesCommentButton ...@@ -61,13 +58,13 @@ class @FilesCommentButton
initializedButtonTemplate = @COMMENT_BUTTON_TEMPLATE initializedButtonTemplate = @COMMENT_BUTTON_TEMPLATE
COMMENT_BUTTON_CLASS: @COMMENT_BUTTON_CLASS.substr 1 COMMENT_BUTTON_CLASS: @COMMENT_BUTTON_CLASS.substr 1
$(initializedButtonTemplate).attr $(initializedButtonTemplate).attr
'data-noteable-id': buttonAttributes.id.noteable 'data-noteable-id': buttonAttributes.noteable_id
'data-commit-id': buttonAttributes.id.commit 'data-commit-id': buttonAttributes.commit_id
'data-discussion-id': buttonAttributes.id.discussion 'data-discussion-id': buttonAttributes.discussion_id
'data-noteable-type': buttonAttributes.type.noteable 'data-noteable-type': buttonAttributes.noteable_type
'data-line-type': buttonAttributes.type.line 'data-line-type': buttonAttributes.line_type
'data-note-type': buttonAttributes.type.note 'data-note-type': buttonAttributes.note_type
'data-line-code': buttonAttributes.code.line 'data-line-code': buttonAttributes.line_code
getTextFileElement: (hoveredElement) -> getTextFileElement: (hoveredElement) ->
$(hoveredElement.closest(@TEXT_FILE_SELECTOR)) $(hoveredElement.closest(@TEXT_FILE_SELECTOR))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment