From 71339ce56a658da2a03ecc3bc5c575ea3e9d7566 Mon Sep 17 00:00:00 2001 From: sienori Date: Tue, 20 Feb 2018 15:26:46 +0900 Subject: [PATCH] Do not translate input type=password --- simple-translate/simple-translate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simple-translate/simple-translate.js b/simple-translate/simple-translate.js index 7418d6f..0392eb5 100644 --- a/simple-translate/simple-translate.js +++ b/simple-translate/simple-translate.js @@ -14,6 +14,8 @@ window.addEventListener("mouseup", Select, false); //テキスト選択時の処理 ダブルクリックした時2回処理が走るのを何とかしたい function Select(e) { hidePanel(e); + if (e.target.tagName == "INPUT" && e.target.type == "password") return; + setTimeout(function () { //誤動作防止の為ディレイを設ける if (e.target.tagName == "INPUT" || e.target.tagName == "TEXTAREA") { selectionWord = e.target.value.substring(e.target.selectionStart, e.target.selectionEnd);