Skip to content

Commit b942fa4

Browse files
committed
<style> element generated on render - working on HTML and non-HTML tooltips
1 parent 7f3741e commit b942fa4

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

src/utils/idGenerator.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/utils/uuid.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* By w3resource, 2020, https://www.w3resource.com/javascript-exercises/javascript-math-exercise-23.php
3+
*/
4+
5+
export function generateUUID(){
6+
var dt = new Date().getTime();
7+
8+
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
9+
var r = (dt + Math.random()*16)%16 | 0;
10+
dt = Math.floor(dt/16);
11+
return (c === "x" ? r :(r&0x3|0x8)).toString(16);
12+
});
13+
14+
uuid = "t" + uuid.substring(1, uuid.length); // CSS does not work correctly with classes starting with a numeric character
15+
16+
return uuid;
17+
}

0 commit comments

Comments
 (0)