forked from GitHub/gf-core
minibar: add a visual hint that linearizations can be expanded into tables
This commit is contained in:
@@ -103,12 +103,10 @@ Translations.prototype.target_lang=function() {
|
|||||||
|
|
||||||
Translations.prototype.show_translations=function(translationResults) {
|
Translations.prototype.show_translations=function(translationResults) {
|
||||||
var self=this;
|
var self=this;
|
||||||
function tdt(tree_btn,s,action) {
|
function tdt(tree_btn,txt,action) {
|
||||||
var txt=text(s);
|
|
||||||
if(action) {
|
if(action) {
|
||||||
txt=wrap("span",[txt])
|
txt=wrap("span",txt)
|
||||||
txt.onclick=action
|
txt.onclick=action
|
||||||
//txt=button(s,action)
|
|
||||||
}
|
}
|
||||||
return self.options.show_trees ? td([tree_btn,text(" "),txt]) : td(txt)
|
return self.options.show_trees ? td([tree_btn,text(" "),txt]) : td(txt)
|
||||||
}
|
}
|
||||||
@@ -122,8 +120,10 @@ Translations.prototype.show_translations=function(translationResults) {
|
|||||||
}
|
}
|
||||||
function draw_row(row) {
|
function draw_row(row) {
|
||||||
return tr([td(text(row.params)),td(draw_texts(row.texts))])
|
return tr([td(text(row.params)),td(draw_texts(row.texts))])
|
||||||
}
|
} // ▼ ▾
|
||||||
return wrap_class("table","lintable",lintable.map(draw_row))
|
return wrap("span",
|
||||||
|
[text("▾ "),
|
||||||
|
wrap_class("table","lintable",lintable.map(draw_row))])
|
||||||
}
|
}
|
||||||
function get_tabular() {
|
function get_tabular() {
|
||||||
var t=this
|
var t=this
|
||||||
@@ -139,7 +139,7 @@ Translations.prototype.show_translations=function(translationResults) {
|
|||||||
self.server.pgf_call("linearizeTable",{"tree":tree,"to":lin.to},
|
self.server.pgf_call("linearizeTable",{"tree":tree,"to":lin.to},
|
||||||
show_table)
|
show_table)
|
||||||
}
|
}
|
||||||
return tdt(tree_btn,lin.text,get_tabular)
|
return tdt(tree_btn,text("▸ "+lin.text),get_tabular) // ▶
|
||||||
}
|
}
|
||||||
with(self) {
|
with(self) {
|
||||||
var trans=main;
|
var trans=main;
|
||||||
@@ -177,7 +177,7 @@ Translations.prototype.show_translations=function(translationResults) {
|
|||||||
tdt(node("span",{},
|
tdt(node("span",{},
|
||||||
[abstree_button(t.tree),
|
[abstree_button(t.tree),
|
||||||
alignment_button(t.tree,to=="All",toLangs)]),
|
alignment_button(t.tree,to=="All",toLangs)]),
|
||||||
t.tree)]));
|
text(t.tree))]));
|
||||||
}
|
}
|
||||||
for(var i=0;i<lin.length;i++) {
|
for(var i=0;i<lin.length;i++) {
|
||||||
if(lin[i].to==to && toLangs.length==1)
|
if(lin[i].to==to && toLangs.length==1)
|
||||||
|
|||||||
Reference in New Issue
Block a user