summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-01 17:02:48 +0100
committerDouwe Maan <douwe@selenight.nl>2016-07-24 13:10:38 -0600
commit0ab8264ea622a1d38ab457b368804fad4cb003ca (patch)
tree54c2a54b945568d4c6259b27f00af56db6914792 /app
parent70b46b280c07807c4df0a0c2c8b71d725a60f8c7 (diff)
downloadgitlab-ce-0ab8264ea622a1d38ab457b368804fad4cb003ca.tar.gz
VueJS updates
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/line_comments/application.js.coffee8
-rw-r--r--app/assets/javascripts/line_comments/components/resolve_all.js.coffee4
-rw-r--r--app/assets/javascripts/line_comments/components/resolve_btn.js.coffee7
-rw-r--r--app/views/projects/merge_requests/_show.html.haml2
-rw-r--r--app/views/projects/notes/_note.html.haml2
5 files changed, 13 insertions, 10 deletions
diff --git a/app/assets/javascripts/line_comments/application.js.coffee b/app/assets/javascripts/line_comments/application.js.coffee
index 3c0957ce458..cb9ff54ac05 100644
--- a/app/assets/javascripts/line_comments/application.js.coffee
+++ b/app/assets/javascripts/line_comments/application.js.coffee
@@ -2,9 +2,13 @@
#= require_directory ./stores
#= require_directory ./components
-$ ->
- new Vue
+$ =>
+ @DiffNotesApp = new Vue
el: '#notes'
+ components:
+ 'resolve-btn': ResolveBtn
new Vue
el: '#resolve-all-app'
+ components:
+ 'resolve-all': ResolveAll
diff --git a/app/assets/javascripts/line_comments/components/resolve_all.js.coffee b/app/assets/javascripts/line_comments/components/resolve_all.js.coffee
index 0cc19a7a399..76add1ed005 100644
--- a/app/assets/javascripts/line_comments/components/resolve_all.js.coffee
+++ b/app/assets/javascripts/line_comments/components/resolve_all.js.coffee
@@ -1,4 +1,4 @@
-ResolveAll = Vue.extend
+@ResolveAll = Vue.extend
data: ->
{ comments: CommentsStore.state }
computed:
@@ -15,5 +15,3 @@ ResolveAll = Vue.extend
updateAll: ->
resolveAll = !(this.resolved is this.commentsCount)
CommentsStore.updateAll(resolveAll)
-
-Vue.component 'resolve-all', ResolveAll
diff --git a/app/assets/javascripts/line_comments/components/resolve_btn.js.coffee b/app/assets/javascripts/line_comments/components/resolve_btn.js.coffee
index 7470dc517fe..3363f0a9854 100644
--- a/app/assets/javascripts/line_comments/components/resolve_btn.js.coffee
+++ b/app/assets/javascripts/line_comments/components/resolve_btn.js.coffee
@@ -1,4 +1,4 @@
-ResolveBtn = Vue.extend
+@ResolveBtn = Vue.extend
props:
noteId: Number
resolved: Boolean
@@ -18,7 +18,8 @@ ResolveBtn = Vue.extend
this.$nextTick this.updateTooltip
compiled: ->
$(this.$el).tooltip()
+ destroyed: ->
+ console.log this.noteId
created: ->
+ console.log this.noteId
CommentsStore.create(this.noteId, this.resolved)
-
-Vue.component 'resolve-btn', ResolveBtn
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index de6d3d52936..be38341c6b2 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -47,7 +47,7 @@
#resolve-all-app{ "v-cloak" => true }
%resolve-all{ "inline-template" => true }
.line-resolve-all{ "v-show" => "commentsCount > 0" }
- %button.btn.btn-gray{ type: "button", "aria-label" => "Resolve all", "v-on:click" => "updateAll" }
+ %button.btn.btn-gray{ type: "button", "aria-label" => "Resolve all", "@click" => "updateAll" }
{{ buttonText }}
%span.line-resolve-text
{{ resolved }}/{{ commentsCount }} comments resolved
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index beaae53992d..ed304aef4dc 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -22,7 +22,7 @@
%span.note-role.hidden-xs= access
- unless note.system
%resolve-btn{ ":note-id" => note.id, ":resolved" => "false", "inline-template" => true }
- %button.note-action-button.line-resolve-btn{ type: "button", "v-bind:class" => "{ 'is-active': isResolved }", "v-bind:aria-label" => "buttonText", "v-on:click" => "resolve", "v-bind:title" => "buttonText" }
+ %button.note-action-button.line-resolve-btn{ type: "button", ":class" => "{ 'is-active': isResolved }", ":aria-label" => "buttonText", "@click" => "resolve", ":title" => "buttonText" }
= icon("check")
- if current_user and not note.system
= link_to '#', title: 'Award Emoji', class: 'note-action-button note-emoji-button js-add-award js-note-emoji', data: { position: 'right' } do