minibar: fix for recently introduced bug affacting Webkit browsers

It seems that in Gecko browsers, the effect of "with(x) stmts" reaches inside
the bodies of local functions in stmts, but in Webkit browers it does not.
This commit is contained in:
hallgren
2012-03-19 15:15:47 +00:00
parent 476c8cd59e
commit 053a29bd67

View File

@@ -69,8 +69,9 @@ function Minibar(server,opts) {
}
Minibar.prototype.show_grammarlist=function(grammars) {
this.grammar_menu=empty_id("select","grammar_menu");
with(this) {
var t=this;
t.grammar_menu=empty_id("select","grammar_menu");
with(t) {
if(grammars.length>1) {
function opt(g) { return option(g,g); }
appendChildren(grammar_menu,map(opt,grammars));
@@ -78,7 +79,7 @@ Minibar.prototype.show_grammarlist=function(grammars) {
var grammar_name=grammar_menu.value
if(window.localStorage)
localStorage["gf.minibar.last_grammar"]=grammar_name;
select_grammar(grammar_name);
t.select_grammar(grammar_name);
}
grammar_menu.onchange=bind(pick,this);
insertFirst(menubar,button("i",bind(show_grammarinfo,this)))