summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/blob/viewer/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/blob/viewer/index.js')
-rw-r--r--app/assets/javascripts/blob/viewer/index.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js
index b4cd0d5d875..4741152afce 100644
--- a/app/assets/javascripts/blob/viewer/index.js
+++ b/app/assets/javascripts/blob/viewer/index.js
@@ -62,6 +62,7 @@ export default class BlobViewer {
this.switcher = document.querySelector('.js-blob-viewer-switcher');
this.switcherBtns = document.querySelectorAll('.js-blob-viewer-switch-btn');
this.copySourceBtn = document.querySelector('.js-copy-blob-source-btn');
+ this.copySourceBtnTooltip = document.querySelector('.js-copy-blob-source-btn-tooltip');
this.simpleViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type="simple"]');
this.richViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type="rich"]');
@@ -109,23 +110,23 @@ export default class BlobViewer {
toggleCopyButtonState() {
if (!this.copySourceBtn) return;
if (this.simpleViewer.getAttribute('data-loaded')) {
- this.copySourceBtn.setAttribute('title', __('Copy file contents'));
+ this.copySourceBtnTooltip.setAttribute('title', __('Copy file contents'));
this.copySourceBtn.classList.remove('disabled');
} else if (this.activeViewer === this.simpleViewer) {
- this.copySourceBtn.setAttribute(
+ this.copySourceBtnTooltip.setAttribute(
'title',
__('Wait for the file to load to copy its contents'),
);
this.copySourceBtn.classList.add('disabled');
} else {
- this.copySourceBtn.setAttribute(
+ this.copySourceBtnTooltip.setAttribute(
'title',
__('Switch to the source to copy the file contents'),
);
this.copySourceBtn.classList.add('disabled');
}
- fixTitle($(this.copySourceBtn));
+ fixTitle($(this.copySourceBtnTooltip));
}
switchToViewer(name) {