mirror of
https://github.com/wassname/talk.git
synced 2026-07-24 13:20:47 +08:00
Merge branch 'master' into hebrew
This commit is contained in:
@@ -36,7 +36,18 @@ export default class PermalinkButton extends React.Component {
|
||||
};
|
||||
|
||||
copyPermalink = () => {
|
||||
this.permalinkInput.select();
|
||||
const iOS = navigator && navigator.userAgent.match(/ipad|iphone/i);
|
||||
|
||||
if (iOS) {
|
||||
let range = document.createRange();
|
||||
range.selectNodeContents(this.permalinkInput);
|
||||
let selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
this.permalinkInput.setSelectionRange(0, 999999);
|
||||
} else {
|
||||
this.permalinkInput.select();
|
||||
}
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
this.setState({
|
||||
|
||||
Reference in New Issue
Block a user