-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from henriqueccruz/master
v2.2.1
- Loading branch information
Showing
22 changed files
with
9,775 additions
and
10,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//=include functions/_copyPaghiperEmv.js | ||
|
||
jQuery(document).ready( function($){ | ||
|
||
// Deal with dismissable notices | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function copyPaghiperEmv() { | ||
|
||
// Start with objects to be selected | ||
let paghiperEmvBlock = document.querySelector('.paghiper-pix-code'); | ||
let targetPixCode = paghiperEmvBlock.querySelector('textarea'); | ||
let targetButton = paghiperEmvBlock.querySelector('button'); | ||
|
||
// Select the text field | ||
targetPixCode.select(); | ||
targetPixCode.setSelectionRange(0, 99999); /* For mobile devices */ | ||
|
||
// Copy the text inside the text field | ||
navigator.clipboard.writeText(targetPixCode.value); | ||
|
||
// Store selection range insie button dataset | ||
targetButton.dataset.originalText = targetButton.innerHTML; | ||
targetButton.innerHTML = 'Copiado!'; | ||
|
||
setTimeout(function(targetButton) { | ||
|
||
// Restore original text from dataset store value | ||
let originalText = targetButton.dataset.originalText; | ||
targetButton.innerHTML = originalText; | ||
|
||
// Remove selection range | ||
document.getSelection().removeAllRanges(); | ||
}, 2000, targetButton,); | ||
|
||
} |
Oops, something went wrong.