minor bug fixes, with declaring variables (avoids accidents)

main
Steve Nyemba 3 hours ago
parent 972d6f9bb3
commit c402c47b29

@ -1,20 +1,20 @@
var ai = {}
ai.toggle = function (){
if($('.ai-button').html().match(/check/i)){
if($('.ai-button').html().match(/toggle-on/i)){
ai.disable()
}else{
ai.enable()
}
sessionStorage.AI = _val
$('.ai-button').html (_icon)
$('.ai-status').html(_status).css({color:_color})
// sessionStorage.AI = _val
// $('.ai-button').html (_icon)
// $('.ai-status').html(_status).css({color:_color})
}
ai.enable = function (){
_val = 1
_status = 'Enabled'
_color = '#4682B4'
_icon = '<i class="fa-solid fa-check" style="color:green"></i>'
var _status = 'Enabled'
var _color = '#4682B4'
var _icon = '<i class="fa-solid fa-toggle-on" style="color:#4682b4"></i>'
$('.ai-workbench-status').html('AI Enabled').css({'color':'#4682b4'})
sessionStorage.AI = _val
$('.ai-button').html (_icon)
@ -23,10 +23,10 @@
}
ai.disable = function (){
_val = 0
_status = 'Disabled'
_color = 'maroon'
_icon = '<i class="fa-solid fa-times" style="color:maroon"></i>'
var _val = 0
var _status = 'Disabled'
var _color = 'maroon'
var _icon = '<i class="fa-solid fa-toggle-off" style="color:maroon"></i>'
$('.ai-workbench-status').html('AI Disabled').css({'color':'maroon'})
sessionStorage.AI = _val
$('.ai-button').html (_icon)

Loading…
Cancel
Save