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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
839d7f3c
Commit
839d7f3c
authored
Feb 07, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving constants to $options
parent
fad64474
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
21 deletions
+14
-21
app/assets/javascripts/blob/components/blob_header_default_actions.vue
...vascripts/blob/components/blob_header_default_actions.vue
+9
-18
app/assets/javascripts/blob/components/constants.js
app/assets/javascripts/blob/components/constants.js
+5
-3
No files found.
app/assets/javascripts/blob/components/blob_header_default_actions.vue
View file @
839d7f3c
<
script
>
import
{
GlButton
,
GlButtonGroup
,
GlIcon
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
BTN_COPY_CONTENTS_TITLE
,
BTN_DOWNLOAD_TITLE
,
BTN_RAW_TITLE
}
from
'
./constants
'
;
export
default
{
...
...
@@ -19,15 +18,6 @@ export default {
},
},
computed
:
{
copyBtnTitle
()
{
return
__
(
BTN_COPY_CONTENTS_TITLE
);
},
rawBtnTitle
()
{
return
__
(
BTN_RAW_TITLE
);
},
downloadBtnTitle
()
{
return
__
(
BTN_DOWNLOAD_TITLE
);
},
rawUrl
()
{
return
this
.
blob
.
rawPath
;
},
...
...
@@ -40,34 +30,35 @@ export default {
this
.
$emit
(
'
copy
'
);
},
},
BTN_COPY_CONTENTS_TITLE
,
BTN_DOWNLOAD_TITLE
,
BTN_RAW_TITLE
,
};
</
script
>
<
template
>
<gl-button-group>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"
copyBtnTitle
"
:title=
"
copyBtnTitle
"
:aria-label=
"
$options.BTN_COPY_CONTENTS_TITLE
"
:title=
"
$options.BTN_COPY_CONTENTS_TITLE
"
@
click=
"requestCopyContents"
>
<gl-icon
name=
"copy-to-clipboard"
:size=
"14"
/>
</gl-button>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"
rawBtnTitle
"
:title=
"
rawBtnTitle
"
:aria-label=
"
$options.BTN_RAW_TITLE
"
:title=
"
$options.BTN_RAW_TITLE
"
:href=
"rawUrl"
rel=
"noopener noreferrer"
target=
"_blank"
>
<gl-icon
name=
"doc-code"
:size=
"14"
/>
</gl-button>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"
downloadBtnTitle
"
:title=
"
downloadBtnTitle
"
:aria-label=
"
$options.BTN_DOWNLOAD_TITLE
"
:title=
"
$options.BTN_DOWNLOAD_TITLE
"
:href=
"downloadUrl"
rel=
"noopener noreferrer"
target=
"_blank"
>
<gl-icon
name=
"download"
:size=
"14"
/>
...
...
app/assets/javascripts/blob/components/constants.js
View file @
839d7f3c
export
const
BTN_COPY_CONTENTS_TITLE
=
'
Copy file contents
'
;
export
const
BTN_RAW_TITLE
=
'
Open raw
'
;
export
const
BTN_DOWNLOAD_TITLE
=
'
Download
'
;
import
{
__
}
from
'
~/locale
'
;
export
const
BTN_COPY_CONTENTS_TITLE
=
__
(
'
Copy file contents
'
);
export
const
BTN_RAW_TITLE
=
__
(
'
Open raw
'
);
export
const
BTN_DOWNLOAD_TITLE
=
__
(
'
Download
'
);
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