summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-06-17 05:26:56 +0200
committerByron Jones <glob@mozilla.com>2015-06-17 05:26:56 +0200
commit5297b573916313453abfc16db9200a6a2be71464 (patch)
tree889eb4acda6f8301ad3de54304ebaa21d37e289c /extensions/BugModal
parent379d122f297cee76752388892223bcd3f1df0235 (diff)
downloadbugzilla-5297b573916313453abfc16db9200a6a2be71464.tar.gz
bugzilla-5297b573916313453abfc16db9200a6a2be71464.tar.xz
Bug 1149593: Hovering over "Copy Summary" changes the button to a grey box
Diffstat (limited to 'extensions/BugModal')
-rw-r--r--extensions/BugModal/web/bug_modal.js42
1 files changed, 30 insertions, 12 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index a0f83803f..8ff4b2921 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -163,19 +163,37 @@ $(function() {
// copy summary to clipboard
if ($('#copy-summary').length) {
- var zero = new ZeroClipboard($('#copy-summary'));
- zero.on({
- 'error': function(event) {
- console.log(event.message);
- zero.destroy();
- $('#copy-summary').hide();
- },
- 'copy': function(event) {
- var clipboard = event.clipboardData;
- clipboard.setData('text/plain', 'Bug ' + BUGZILLA.bug_id + ' - ' + $('#field-value-short_desc').text());
- }
- });
+ // we don't know if flash is enabled without waiting for load to timeout
+ // remember the flash enabled state between pages
+ var hasFlash = true;
+ if (localStorage.getItem('hasFlash') === null) {
+ $('#copy-summary').hide();
+ }
+ else {
+ hasFlash = localStorage.getItem('hasFlash');
+ }
+ if (hasFlash) {
+ ZeroClipboard.config({ flashLoadTimeout: 5000 });
+ var zero = new ZeroClipboard($('#copy-summary'));
+ zero.on({
+ 'ready': function(event) {
+ $('#copy-summary').show();
+ localStorage.setItem('hasFlash', true);
+ },
+ 'error': function(event) {
+ console.log(event.message);
+ zero.destroy();
+ $('#global-zeroclipboard-html-bridge').remove();
+ $('#copy-summary').hide();
+ localStorage.removeItem('hasFlash');
+ },
+ 'copy': function(event) {
+ var clipboard = event.clipboardData;
+ clipboard.setData('text/plain', 'Bug ' + BUGZILLA.bug_id + ' - ' + $('#field-value-short_desc').text());
+ }
+ });
+ }
}
// lightboxes