forked from GitHub/gf-core
Syntax editor: fix bug in Firefox, Seamonkey
This commit is contained in:
@@ -84,27 +84,26 @@ Editor.prototype.start_fresh=function () {
|
|||||||
/* --- Functions for handling tree manipulation ----------------------------- */
|
/* --- Functions for handling tree manipulation ----------------------------- */
|
||||||
|
|
||||||
Editor.prototype.get_refinements=function(cat) {
|
Editor.prototype.get_refinements=function(cat) {
|
||||||
with (this) {
|
var t = this;
|
||||||
if (cat == undefined)
|
if (cat == undefined)
|
||||||
cat = ast.getCat();
|
cat = t.ast.getCat();
|
||||||
var args = {
|
var args = {
|
||||||
id: cat,
|
id: cat,
|
||||||
format: "json"
|
format: "json"
|
||||||
};
|
};
|
||||||
var cont = function(data){
|
var cont = function(data){
|
||||||
clear(refinements);
|
clear(t.ui.refinements);
|
||||||
for (pi in data.producers) {
|
for (pi in data.producers) {
|
||||||
var opt = span_class("refinement", text(data.producers[pi]));
|
var opt = span_class("refinement", text(data.producers[pi]));
|
||||||
opt.onclick = function(){ select_refinement(this.innerText) };
|
opt.onclick = bind(function(){ t.select_refinement(this.innerHTML) }, opt);
|
||||||
refinements.appendChild(opt);
|
t.ui.refinements.appendChild(opt);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var err = function(data){
|
var err = function(data){
|
||||||
clear(refinements);
|
clear(t.ui.refinements);
|
||||||
alert("no refinements");
|
alert("No refinements");
|
||||||
};
|
};
|
||||||
server.browse(args,cont,err);
|
t.server.browse(args, cont, err);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor.prototype.select_refinement=function(fun) {
|
Editor.prototype.select_refinement=function(fun) {
|
||||||
|
|||||||
Reference in New Issue
Block a user