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
7a78292f
Commit
7a78292f
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
e9770f81
Changes
3
Hide 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 @
7a78292f
...
...
@@ -35,7 +35,7 @@ function genericError(e) {
showTooltip
(
e
.
trigger
,
`Press
${
key
}
-C to copy`
);
}
$
(()
=>
{
export
default
function
initCopyToClipboard
()
{
const
clipboard
=
new
Clipboard
(
'
[data-clipboard-target], [data-clipboard-text]
'
);
clipboard
.
on
(
'
success
'
,
genericSuccess
);
clipboard
.
on
(
'
error
'
,
genericError
);
...
...
@@ -70,4 +70,4 @@ $(() => {
clipboardData
.
setData
(
'
text/plain
'
,
json
.
text
);
clipboardData
.
setData
(
'
text/x-gfm
'
,
json
.
gfm
);
});
}
);
}
app/assets/javascripts/behaviors/index.js
View file @
7a78292f
import
'
./autosize
'
;
import
'
./bind_in_out
'
;
import
initCopyAsGFM
from
'
./copy_as_gfm
'
;
import
initCopyToClipboard
from
'
./copy_to_clipboard
'
;
import
'
./details_behavior
'
;
import
installGlEmojiElement
from
'
./gl_emoji
'
;
import
'
./quick_submit
'
;
...
...
@@ -9,3 +10,4 @@ import './toggler_behavior';
installGlEmojiElement
();
initCopyAsGFM
();
initCopyToClipboard
();
app/assets/javascripts/main.js
View file @
7a78292f
...
...
@@ -44,7 +44,6 @@ import './commits';
import
'
./compare
'
;
import
'
./compare_autocomplete
'
;
import
'
./confirm_danger_modal
'
;
import
'
./copy_to_clipboard
'
;
import
'
./diff
'
;
import
'
./files_comment_button
'
;
import
Flash
,
{
removeFlashClickListener
}
from
'
./flash
'
;
...
...
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