1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

repair share bug (#2449)

This commit is contained in:
山水人家
2018-10-15 16:11:37 +08:00
committed by Daniel Pan
parent 62f0cfbbcd
commit 55f8277d43

View File

@@ -466,7 +466,15 @@ define([
copySharedLink: function(e) {
var $el = $(e.currentTarget);
$el.prev('.shared-link').select();
var targetDom = $el.prev('.shared-link');
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { //ios
window.getSelection().removeAllRanges();
var range = document.createRange();
range.selectNode(targetDom[0]);
window.getSelection().addRange(range);
} else {
targetDom.select();
}
document.execCommand('copy');
$.modal.close();
Common.feedback(gettext("Share link is copied to the clipboard."), 'success');