Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: removed JQuery dependency from canvasApi.js file #246

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/simulator/src/canvasApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ export function changeScale(delta, xx, yy, method = 1) {
if (!embed && !lightMode) {
findDimensions(globalScope)
miniMapArea.setup()
$('#miniMap').show()
let miniMap = document.querySelector('#miniMap');
miniMap.style.display = 'block';
updatelastMinimapShown()
$('#miniMap').show()
miniMap.style.display = 'block';
setTimeout(removeMiniMap, 2000)
}
}
Expand Down Expand Up @@ -441,9 +442,9 @@ export function drawLine(ctx, x1, y1, x2, y2, color, width) {

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

// Helper function to color "RED" to RGBA
Expand Down
Loading