Fix unguarded localStorage access

main
Isaiah Odhner 2017-10-30 15:36:29 -04:00
parent c3742cdad3
commit 5bdcd9a19e
3 changed files with 11 additions and 8 deletions

View File

@ -52,7 +52,6 @@
* If you open an image it resets the zoom but if you're on the magnification tool it doesn't update the options
* If you zoom in with the magnifier without previously changing the magnification on the toolbar,
then switch back to the magnifier, the toolbar doesn't show any magnification highlighted
* Unshielded `localStorage` access for Extras menu visibility value
* The TextBox contents move down and right when rasterizing
* If you click on a menu item (up/down) and then move over to a menu item and click (up/down) it does nothing (and you can repeat this)
* Can't glide thru tool options in Firefox, mobile Chrome;

View File

@ -178,9 +178,11 @@ function $MenuBar(menus){
$menu_button.addClass("" + menu_id + "-menu-button");
if(menu_id == "extras"){
// TODO: refactor shared key string, move to function
if(localStorage["jspaint extras menu visible"] != "true"){
$menu_button.hide();
}
try{
if(localStorage["jspaint extras menu visible"] != "true"){
$menu_button.hide();
}
}catch(e){}
}
$menu_popup.hide();

View File

@ -496,7 +496,9 @@ $menu_bar.on("default-info", function(e){
});
var $extras_menu_button = $menu_bar.get(0).ownerDocument.defaultView.$(".extras-menu-button");
// TODO: refactor shared key string
if(localStorage["jspaint extras menu visible"] != "true"){
$extras_menu_button.hide();
}
try{
// TODO: refactor shared key string
if(localStorage["jspaint extras menu visible"] != "true"){
$extras_menu_button.hide();
}
}catch(e){}