Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a25af3ef
Commit
a25af3ef
authored
Jan 11, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert notification subscription button into toggle
parent
34760245
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
22 deletions
+11
-22
app/assets/javascripts/sidebar/components/subscriptions/subscriptions.vue
...cripts/sidebar/components/subscriptions/subscriptions.vue
+9
-16
app/assets/javascripts/vue_shared/components/toggle_button.vue
...ssets/javascripts/vue_shared/components/toggle_button.vue
+2
-2
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+0
-4
No files found.
app/assets/javascripts/sidebar/components/subscriptions/subscriptions.vue
View file @
a25af3ef
...
...
@@ -2,11 +2,11 @@
/* eslint-disable vue/require-default-prop */
import
{
__
}
from
'
../../../locale
'
;
import
eventHub
from
'
../../event_hub
'
;
import
loadingButton
from
'
../../../vue_shared/components/loading
_button.vue
'
;
import
toggleButton
from
'
../../../vue_shared/components/toggle
_button.vue
'
;
export
default
{
components
:
{
loading
Button
,
toggle
Button
,
},
props
:
{
loading
:
{
...
...
@@ -24,15 +24,8 @@
},
},
computed
:
{
buttonLabel
()
{
let
label
;
if
(
this
.
subscribed
===
false
)
{
label
=
__
(
'
Subscribe
'
);
}
else
if
(
this
.
subscribed
===
true
)
{
label
=
__
(
'
Unsubscribe
'
);
}
return
label
;
showLoadingState
()
{
return
this
.
subscribed
===
null
||
this
.
loading
;
},
},
methods
:
{
...
...
@@ -55,12 +48,12 @@
<span
class=
"issuable-header-text hide-collapsed pull-left"
>
{{
__
(
'
Notifications
'
)
}}
</span>
<
loading
-button
<
toggle
-button
ref=
"loadingButton"
class=
"
btn btn-default
pull-right hide-collapsed js-issuable-subscribe-button"
:
loading=
"loading
"
:
label=
"buttonLabel
"
@
c
lick
=
"toggleSubscription"
class=
"pull-right hide-collapsed js-issuable-subscribe-button"
:
is-loading=
"showLoadingState
"
:
value=
"subscribed
"
@
c
hange
=
"toggleSubscription"
/>
</div>
</
template
>
app/assets/javascripts/vue_shared/components/toggle_button.vue
View file @
a25af3ef
...
...
@@ -23,11 +23,10 @@
name
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
value
:
{
type
:
Boolean
,
required
:
tru
e
,
required
:
fals
e
,
},
disabledInput
:
{
type
:
Boolean
,
...
...
@@ -61,6 +60,7 @@
<
template
>
<label
class=
"toggle-wrapper"
>
<input
v-if=
"name"
type=
"hidden"
:name=
"name"
:value=
"value"
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
a25af3ef
...
...
@@ -162,10 +162,6 @@
border
:
0
;
}
span
{
display
:
inline-block
;
}
.select2-container
span
{
margin-top
:
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment