Skip to content

Commit 2280ba4

Browse files
committed
Merge pull request #1 from gareth-instil/master
set btn outside of if block
2 parents d852cbc + fc7c294 commit 2280ba4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/angular-zeroclipboard.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ directive('uiZeroclip', ['$document', '$window', 'uiZeroclipConfig',
4747
link: function(scope, elm, attrs) {
4848
// config
4949
ZeroClipboard.config(zeroclipConfig);
50+
var btn = elm[0];
5051
if (!attrs.id) {
5152
attrs.$set('id', 'uiZeroclip' + _id);
52-
var btn = document.createElement('button');
53+
btn = document.createElement('button');
5354
btn.appendChild(document.createTextNode(options.buttonText));
5455
btn.setAttribute('data-clipboard-target', 'uiZeroclip' + _id);
5556
btn.setAttribute('class', options.buttonClass);
@@ -72,4 +73,4 @@ directive('uiZeroclip', ['$document', '$window', 'uiZeroclipConfig',
7273
}
7374
}
7475
}
75-
]);
76+
]);

0 commit comments

Comments
 (0)