mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 18:02:54 -06:00
gfse: show the grammar list if the currently selected grammar can not be loaded
Avoid showing a blank page if there is an unexpected problem with the grammars in localStorage.
This commit is contained in:
@@ -199,9 +199,15 @@ function clone_grammar(i) {
|
|||||||
|
|
||||||
function open_grammar(i) {
|
function open_grammar(i) {
|
||||||
var g=get_grammar(i);
|
var g=get_grammar(i);
|
||||||
g.index=i;
|
if(g) {
|
||||||
local.put("current",i+1);
|
g.index=i;
|
||||||
edit_grammar(g);
|
local.put("current",i+1);
|
||||||
|
edit_grammar(g);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Something went wrong: grammar at index "+i+" is not usable.")
|
||||||
|
draw_grammar_list()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function open_public(file) {
|
function open_public(file) {
|
||||||
|
|||||||
Reference in New Issue
Block a user