diff options
| author | hallgren <hallgren@chalmers.se> | 2012-10-03 13:22:50 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-10-03 13:22:50 +0000 |
| commit | 3582ae6e085fcc2cfa2e0457c5674e22c5980fa5 (patch) | |
| tree | 7ab1d82a06b0539670420fd32f70ac0811c2ccff /src/www/gfse/editor.js | |
| parent | a1d2d11057b1ab727fdbec4430808d53d67128b1 (diff) | |
gfse: some refactoring
Diffstat (limited to 'src/www/gfse/editor.js')
| -rw-r--r-- | src/www/gfse/editor.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/www/gfse/editor.js b/src/www/gfse/editor.js index e59afdefb..703886ab5 100644 --- a/src/www/gfse/editor.js +++ b/src/www/gfse/editor.js @@ -1277,12 +1277,13 @@ function draw_opers(g,ci) { } function delete_lin(g,ci,fun) { - var i; var c=g.concretes[ci]; - for(i=0;i<c.lins.length && c.lins[i].fun!=fun;i++); - if(i<c.lins.length) c.lins=delete_ix(c.lins,i); - timestamp(c); - reload_grammar(g); + var i=lin_index(c,fun); + if(i!=null) { + c.lins=delete_ix(c.lins,i); + timestamp(c); + reload_grammar(g); + } } /* -------------------------------------------------------------------------- */ |
