mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-23 02:03:13 +03:00
use unique hash for MouseTracker
This commit is contained in:
parent
e193557e56
commit
39671f4d78
@ -135,7 +135,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hash = Math.random(); // An unique hash for this tracker.
|
this.hash = uniqueHash(); // An unique hash for this tracker.
|
||||||
/**
|
/**
|
||||||
* The element for which pointer events are being monitored.
|
* The element for which pointer events are being monitored.
|
||||||
* @member {Element} element
|
* @member {Element} element
|
||||||
@ -3764,4 +3764,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @inner
|
||||||
|
*/
|
||||||
|
function uniqueHash( ) {
|
||||||
|
let uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2);
|
||||||
|
while (uniqueId in THIS) {
|
||||||
|
// rehash when not unique
|
||||||
|
uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2);
|
||||||
|
}
|
||||||
|
return uniqueId;
|
||||||
|
}
|
||||||
|
|
||||||
}(OpenSeadragon));
|
}(OpenSeadragon));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user