Commit 1f5b8e88 authored by Jacob Schatz's avatar Jacob Schatz

changes `data-url` to `href` for javascript url grabbing

parent 3e7e7ae0
...@@ -16,12 +16,13 @@ class @Issue ...@@ -16,12 +16,13 @@ class @Issue
initIssueBtnEventListeners: -> initIssueBtnEventListeners: ->
$("a.btn-close, a.btn-reopen").on "click", (e) -> $("a.btn-close, a.btn-reopen").on "click", (e) ->
console.log('closing')
e.preventDefault() e.preventDefault()
e.stopImmediatePropagation() e.stopImmediatePropagation()
$this = $(this) $this = $(this)
isClose = $this.hasClass('btn-close') isClose = $this.hasClass('btn-close')
$this.prop("disabled", true) $this.prop("disabled", true)
url = $this.data('url') url = $this.attr('href')
$.ajax $.ajax
type: 'PUT' type: 'PUT'
url: url, url: url,
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
= icon('plus') = icon('plus')
New Issue New Issue
- if can?(current_user, :update_issue, @issue) - if can?(current_user, :update_issue, @issue)
= link_to 'Reopen', '#', data: {no_turbolink: true, url: issue_path(@issue, issue: {state_event: :reopen}, status_only: true, format: 'json')}, class: "btn btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen Issue' = link_to 'Reopen', issue_path(@issue, issue: {state_event: :reopen}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen Issue'
= link_to 'Close', '#', data: {no_turbolink: true, url: issue_path(@issue, issue: {state_event: :close}, status_only: true, format: 'json')}, class: "btn btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: 'Close Issue' = link_to 'Close', issue_path(@issue, issue: {state_event: :close}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: 'Close Issue'
= link_to edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'btn btn-grouped issuable-edit' do = link_to edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'btn btn-grouped issuable-edit' do
= icon('pencil-square-o') = icon('pencil-square-o')
......
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