Skip to content

use dynamic text instead of static. #1

Open
abukamila wants to merge 1 commit intodudeami0:masterfrom
abukamila:patch-1
Open

use dynamic text instead of static. #1
abukamila wants to merge 1 commit intodudeami0:masterfrom
abukamila:patch-1

Conversation

@abukamila
Copy link

$('#lblCopyLink').zeroclipboard({
text: '#txtFullLink',
hand: true
})
will get val() from '#txtFullLink' instead of print '#txtFullLink'

$('#lblCopyLink').zeroclipboard({
            text: '#txtFullLink',
            hand: true
        })
will get val() from '#txtFullLink' instead of print '#txtFullLink'
@dudeami0
Copy link
Owner

Hmm, would it be acceptable to allow using a function for text? The way you have it right now isn't very flexible. It would work like:

$('#lblCopyLink').zeroclipboard({ text: function () { return $('#txtFullLink').val(); }, hand: true });

@abukamila
Copy link
Author

yup. this would be better for the flexibility

$('#lblCopyLink').zeroclipboard({
text: function () {
return $('#txtFullLink').val();
},
hand: true
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants