Correspond to <input> and <textarea>
This commit is contained in:
parent
969895b488
commit
4565f4716b
|
@ -15,7 +15,13 @@ window.addEventListener("mouseup", Select, false);
|
||||||
function Select(e) {
|
function Select(e) {
|
||||||
hidePanel(e);
|
hidePanel(e);
|
||||||
setTimeout(function () { //誤動作防止の為ディレイを設ける
|
setTimeout(function () { //誤動作防止の為ディレイを設ける
|
||||||
|
//selectionWord = String(window.getSelection());
|
||||||
|
if (e.target.tagName == "INPUT" || e.target.tagName == "TEXTAREA") {
|
||||||
|
selectionWord = e.target.value.substring(e.target.selectionStart, e.target.selectionEnd);
|
||||||
|
} else {
|
||||||
selectionWord = String(window.getSelection());
|
selectionWord = String(window.getSelection());
|
||||||
|
}
|
||||||
|
|
||||||
if ((selectionWord.length !== 0) && (e.button == 0) && (e.target.id !== "simple-translate-panel") && (e.target.parentElement.id !== "simple-translate-panel")) { //選択範囲が存在かつ左クリックかつパネル以外のとき
|
if ((selectionWord.length !== 0) && (e.button == 0) && (e.target.id !== "simple-translate-panel") && (e.target.parentElement.id !== "simple-translate-panel")) { //選択範囲が存在かつ左クリックかつパネル以外のとき
|
||||||
clickPosition = e;
|
clickPosition = e;
|
||||||
if (S.get().ifShowButton) { //ボタンを表示
|
if (S.get().ifShowButton) { //ボタンを表示
|
||||||
|
|
Loading…
Reference in a new issue