mirror of
https://github.com/Mibew/advanced-button-plugin.git
synced 2025-01-22 08:50:30 +03:00
Make plugin compatible with tracking for all types of button
This commit is contained in:
parent
52c54dd5a5
commit
bbeda61ab3
@ -1,7 +1,10 @@
|
|||||||
(function(Mibew) {
|
(function(Mibew) {
|
||||||
Mibew.APIFunctions.refreshButton = function(data) {
|
Mibew.APIFunctions.refreshButton = function(data) {
|
||||||
// Refresh the button image
|
// Refresh the button image (if exists)
|
||||||
var img = document.getElementById("mibew-agent-button").getElementsByTagName("img")[0];
|
var button = document.getElementById("mibew-agent-button");
|
||||||
|
if (!button) { return; }
|
||||||
|
var img = button.getElementsByTagName("img")[0];
|
||||||
|
if (!img) { return; }
|
||||||
var originalSrc = img.src.replace(/&dummy=\d+/, '');
|
var originalSrc = img.src.replace(/&dummy=\d+/, '');
|
||||||
img.src = originalSrc + "&dummy=" + (new Date()).getTime();
|
img.src = originalSrc + "&dummy=" + (new Date()).getTime();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user