mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
call clipboard destroy()
This commit is contained in:
parent
3df119002d
commit
1672ca4edb
@ -91,7 +91,13 @@ function (angular, _, $, require, config) {
|
||||
return function(scope, elem) {
|
||||
require(['vendor/clipboard/dist/clipboard'], function(Clipboard) {
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function() {}; // see https://github.com/zenorocha/clipboard.js/issues/155
|
||||
new Clipboard(elem[0]);
|
||||
scope.clipboard = new Clipboard(elem[0]);
|
||||
});
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
if (scope.clipboard) {
|
||||
scope.clipboard.destroy();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user