Skip to content

Commit 7735bcd

Browse files
refactor: removed JQuery dependency from canvasApi.js file (#246)
refactor: removed-jquery Co-authored-by: Josh Varga <[email protected]>
1 parent 362f7a9 commit 7735bcd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/simulator/src/canvasApi.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ export function changeScale(delta, xx, yy, method = 1) {
108108
if (!embed && !lightMode) {
109109
findDimensions(globalScope)
110110
miniMapArea.setup()
111-
$('#miniMap').show()
111+
let miniMap = document.querySelector('#miniMap');
112+
miniMap.style.display = 'block';
112113
updatelastMinimapShown()
113-
$('#miniMap').show()
114+
miniMap.style.display = 'block';
114115
setTimeout(removeMiniMap, 2000)
115116
}
116117
}
@@ -441,9 +442,9 @@ export function drawLine(ctx, x1, y1, x2, y2, color, width) {
441442

442443
// Checks if string color is a valid color using a hack
443444
export function validColor(color) {
444-
var $div = $('<div>')
445-
$div.css('border', `1px solid ${color}`)
446-
return $div.css('border-color') !== ''
445+
let newDiv = document.createElement('div')
446+
newDiv.style.border = `1px solid ${color}`
447+
return newDiv.style.borderColor !== ''
447448
}
448449

449450
// Helper function to color "RED" to RGBA

0 commit comments

Comments
 (0)