-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathcopy-permalink_3.6.js
More file actions
26 lines (22 loc) · 872 Bytes
/
copy-permalink_3.6.js
File metadata and controls
26 lines (22 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* @license Mozilla Public License Version 2.0
* This script has been developed by the "community"
* There isn't any guarantee that this script will work on another version of Lizmap Web Client.
*/
lizMap.events.on({
'uicreated': function(e) {
let permaLinkDom = "div#permaLink div#tab-share-permalink a#permalink";
var buttonPermaLink = $("div#permaLink div#tab-share-permalink a#permalink");
buttonPermaLink.tooltip({trigger:'click'});
buttonPermaLink.attr('data-original-title', "Lien copié");
document.querySelector(permaLinkDom).addEventListener("click", function(event) {
event.preventDefault();
let permaLinkDomValue = "input-share-permalink"
document.getElementById(permaLinkDomValue).select();
document.execCommand("copy");
setTimeout(function(){
buttonPermaLink.tooltip('hide');
}, 2000);
}, false);
}
});