diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2018-11-27 19:53:16 +0300 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-12-19 12:58:53 +0300 |
commit | 9f9765485e998ece87660aa30a1b4339bb940d14 (patch) | |
tree | 0615fe12d0780847dee1c0dca8c0f0d59674048f /app/assets/javascripts/right_sidebar.js | |
parent | 6c79e9307e116d6115f6d76ac796176952fb83cd (diff) |
Refactor sidebar to use data from serializer
Diffstat (limited to 'app/assets/javascripts/right_sidebar.js')
-rw-r--r-- | app/assets/javascripts/right_sidebar.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index 225e21ad322..93a37e17126 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -79,11 +79,12 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) { Sidebar.prototype.toggleTodo = function(e) { var $btnText, $this, $todoLoading, ajaxType, url; $this = $(e.currentTarget); - ajaxType = $this.attr('data-delete-path') ? 'delete' : 'post'; - if ($this.attr('data-delete-path')) { - url = '' + $this.attr('data-delete-path'); + ajaxType = $this.data('deletePath') ? 'delete' : 'post'; + + if ($this.data('deletePath')) { + url = '' + $this.data('deletePath'); } else { - url = '' + $this.data('url'); + url = '' + $this.data('createPath'); } $this.tooltip('hide'); |