BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a25af3ef
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
22 deletions
+11
-22
subscriptions.vue
...cripts/sidebar/components/subscriptions/subscriptions.vue
+9
-16
toggle_button.vue
...ssets/javascripts/vue_shared/components/toggle_button.vue
+2
-2
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 @@
...
@@ -2,11 +2,11 @@
/* eslint-disable vue/require-default-prop */
/* eslint-disable vue/require-default-prop */
import
{
__
}
from
'../../../locale'
;
import
{
__
}
from
'../../../locale'
;
import
eventHub
from
'../../event_hub'
;
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
{
export
default
{
components
:
{
components
:
{
loading
Button
,
toggle
Button
,
},
},
props
:
{
props
:
{
loading
:
{
loading
:
{
...
@@ -24,15 +24,8 @@
...
@@ -24,15 +24,8 @@
},
},
},
},
computed
:
{
computed
:
{
buttonLabel
()
{
showLoadingState
()
{
let
label
;
return
this
.
subscribed
===
null
||
this
.
loading
;
if
(
this
.
subscribed
===
false
)
{
label
=
__
(
'Subscribe'
);
}
else
if
(
this
.
subscribed
===
true
)
{
label
=
__
(
'Unsubscribe'
);
}
return
label
;
},
},
},
},
methods
:
{
methods
:
{
...
@@ -55,12 +48,12 @@
...
@@ -55,12 +48,12 @@
<span
class=
"issuable-header-text hide-collapsed pull-left"
>
<span
class=
"issuable-header-text hide-collapsed pull-left"
>
{{
__
(
'Notifications'
)
}}
{{
__
(
'Notifications'
)
}}
</span>
</span>
<
loading
-button
<
toggle
-button
ref=
"loadingButton"
ref=
"loadingButton"
class=
"
btn btn-default
pull-right hide-collapsed js-issuable-subscribe-button"
class=
"pull-right hide-collapsed js-issuable-subscribe-button"
:
loading=
"loading
"
:
is-loading=
"showLoadingState
"
:
label=
"buttonLabel
"
:
value=
"subscribed
"
@
c
lick
=
"toggleSubscription"
@
c
hange
=
"toggleSubscription"
/>
/>
</div>
</div>
</
template
>
</
template
>
app/assets/javascripts/vue_shared/components/toggle_button.vue
View file @
a25af3ef
...
@@ -23,11 +23,10 @@
...
@@ -23,11 +23,10 @@
name
:
{
name
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
value
:
{
value
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
tru
e
,
required
:
fals
e
,
},
},
disabledInput
:
{
disabledInput
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -61,6 +60,7 @@
...
@@ -61,6 +60,7 @@
<
template
>
<
template
>
<label
class=
"toggle-wrapper"
>
<label
class=
"toggle-wrapper"
>
<input
<input
v-if=
"name"
type=
"hidden"
type=
"hidden"
:name=
"name"
:name=
"name"
:value=
"value"
:value=
"value"
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
a25af3ef
...
@@ -162,10 +162,6 @@
...
@@ -162,10 +162,6 @@
border
:
0
;
border
:
0
;
}
}
span
{
display
:
inline-block
;
}
.select2-container
span
{
.select2-container
span
{
margin-top
:
0
;
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