simple translator: make it usable on iOS devices

To make the popup menus accessible, use a simple trick to activate the
simulate-hovering-by-tapping behaviour.
This commit is contained in:
hallgren
2012-10-04 22:29:42 +00:00
parent 99b0e42e12
commit 3d47d7b6f9
2 changed files with 14 additions and 10 deletions

View File

@@ -833,7 +833,7 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
return form
}
function draw_options() {
return wrap("div",[span_class("arrow",text(" ⇒ ")),draw_options2()])
return wrap("div",[span_class("arrow",hovertext(" ⇒ ")),draw_options2()])
}
if(t.document.globalsight)
var actions=empty_class("td","actions")
@@ -843,7 +843,7 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
var removeB=dt(text("Remove this segment"))
removeB.onclick=function() { t.remove_segment(i) }
var actions=wrap_class("td","actions",
wrap("div",[span_class("actions",text("◊")),
wrap("div",[span_class("actions",hovertext("◊")),
wrap_class("dl","popupmenu",
[insertB,removeB])]))
}
@@ -1114,3 +1114,7 @@ function delete_button(action,hint) {
b.onclick=action;
return b;
}
function hovertext(txt) {
return node("span",{onclick:""},[text(txt)])
}