summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/header.html.tmpl1
-rw-r--r--extensions/BugModal/web/bug_modal.js43
2 files changed, 24 insertions, 20 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
index 86d4773f2..94b9d57fc 100644
--- a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
@@ -53,7 +53,6 @@
"extensions/BugModal/web/bug_modal.js",
"extensions/BugModal/web/comments.js",
"extensions/BugModal/web/dropdown.js",
- "extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js",
"js/bugzilla-readable-status-min.js",
"js/field.js",
"js/comments.js",
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index 27d8eb01b..5a04709ec 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -324,25 +324,30 @@ $(function() {
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', clipboardSummary());
- }
- });
+ var s = document.createElement("script");
+ s.onload = function () {
+ 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', clipboardSummary());
+ }
+ });
+ };
+ s.src = "extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js";
+ document.getElementsByTagName('head')[0].appendChild(s);
}
}
}