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
2e5ce7e6
Commit
2e5ce7e6
authored
Nov 28, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move copy_to_clipboard to behaviors directory as it is needed on all pages
[ci-skip]
parent
7b893d1b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
app/assets/javascripts/behaviors/copy_to_clipboard.js
app/assets/javascripts/behaviors/copy_to_clipboard.js
+2
-2
app/assets/javascripts/behaviors/index.js
app/assets/javascripts/behaviors/index.js
+2
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-1
No files found.
app/assets/javascripts/copy_to_clipboard.js
→
app/assets/javascripts/
behaviors/
copy_to_clipboard.js
View file @
2e5ce7e6
...
@@ -35,7 +35,7 @@ function genericError(e) {
...
@@ -35,7 +35,7 @@ function genericError(e) {
showTooltip
(
e
.
trigger
,
`Press
${
key
}
-C to copy`
);
showTooltip
(
e
.
trigger
,
`Press
${
key
}
-C to copy`
);
}
}
$
(()
=>
{
export
default
function
initCopyToClipboard
()
{
const
clipboard
=
new
Clipboard
(
'
[data-clipboard-target], [data-clipboard-text]
'
);
const
clipboard
=
new
Clipboard
(
'
[data-clipboard-target], [data-clipboard-text]
'
);
clipboard
.
on
(
'
success
'
,
genericSuccess
);
clipboard
.
on
(
'
success
'
,
genericSuccess
);
clipboard
.
on
(
'
error
'
,
genericError
);
clipboard
.
on
(
'
error
'
,
genericError
);
...
@@ -70,4 +70,4 @@ $(() => {
...
@@ -70,4 +70,4 @@ $(() => {
clipboardData
.
setData
(
'
text/plain
'
,
json
.
text
);
clipboardData
.
setData
(
'
text/plain
'
,
json
.
text
);
clipboardData
.
setData
(
'
text/x-gfm
'
,
json
.
gfm
);
clipboardData
.
setData
(
'
text/x-gfm
'
,
json
.
gfm
);
});
});
}
);
}
app/assets/javascripts/behaviors/index.js
View file @
2e5ce7e6
import
'
./autosize
'
;
import
'
./autosize
'
;
import
'
./bind_in_out
'
;
import
'
./bind_in_out
'
;
import
initCopyAsGFM
from
'
./copy_as_gfm
'
;
import
initCopyAsGFM
from
'
./copy_as_gfm
'
;
import
initCopyToClipboard
from
'
./copy_to_clipboard
'
;
import
'
./details_behavior
'
;
import
'
./details_behavior
'
;
import
installGlEmojiElement
from
'
./gl_emoji
'
;
import
installGlEmojiElement
from
'
./gl_emoji
'
;
import
'
./quick_submit
'
;
import
'
./quick_submit
'
;
...
@@ -9,3 +10,4 @@ import './toggler_behavior';
...
@@ -9,3 +10,4 @@ import './toggler_behavior';
installGlEmojiElement
();
installGlEmojiElement
();
initCopyAsGFM
();
initCopyAsGFM
();
initCopyToClipboard
();
app/assets/javascripts/main.js
View file @
2e5ce7e6
...
@@ -44,7 +44,6 @@ import './commits';
...
@@ -44,7 +44,6 @@ import './commits';
import
'
./compare
'
;
import
'
./compare
'
;
import
'
./compare_autocomplete
'
;
import
'
./compare_autocomplete
'
;
import
'
./confirm_danger_modal
'
;
import
'
./confirm_danger_modal
'
;
import
'
./copy_to_clipboard
'
;
import
Flash
,
{
removeFlashClickListener
}
from
'
./flash
'
;
import
Flash
,
{
removeFlashClickListener
}
from
'
./flash
'
;
import
'
./gl_dropdown
'
;
import
'
./gl_dropdown
'
;
import
'
./gl_field_error
'
;
import
'
./gl_field_error
'
;
...
...
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