Downgrade of zeroclipboard plugin to make compatible with Grunt
This commit is contained in:
parent
ae6a95044c
commit
c7d2c8445b
4 changed files with 13 additions and 12 deletions
|
|
@ -257,7 +257,7 @@ angular.module('copayApp.directives')
|
|||
})
|
||||
.directive('clipCopy', function() {
|
||||
ZeroClipboard.config({
|
||||
moviePath: '/lib/zeroclipboard/dist/ZeroClipboard.swf',
|
||||
moviePath: '/lib/zeroclipboard/ZeroClipboard.swf',
|
||||
trustedDomains: ['*'],
|
||||
allowScriptAccess: 'always',
|
||||
forceHandCursor: true
|
||||
|
|
@ -271,23 +271,24 @@ angular.module('copayApp.directives')
|
|||
link: function(scope, elm) {
|
||||
var client = new ZeroClipboard(elm);
|
||||
|
||||
client.on('ready', function(event) {
|
||||
client.on('copy', function(event) {
|
||||
event.clipboardData.setData('text/plain', scope.clipCopy);
|
||||
});
|
||||
client.on('load', function(client) {
|
||||
|
||||
client.on('aftercopy', function(event) {
|
||||
client.on('datarequested', function(client) {
|
||||
client.setText(scope.clipCopy);
|
||||
} );
|
||||
|
||||
client.on('complete', function(client, args) {
|
||||
elm.removeClass('btn-copy').addClass('btn-copied').html('Copied!');
|
||||
setTimeout(function() {
|
||||
elm.addClass('btn-copy').removeClass('btn-copied').html('');
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
client.on('error', function(event) {
|
||||
console.log('ZeroClipboard error of type "' + event.name + '": ' + event.message);
|
||||
client.on('wrongflash noflash', function() {
|
||||
ZeroClipboard.destroy();
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue