Skip to content

Commit 17a9f5a

Browse files
committed
fix(html): support iOS
1 parent a15137c commit 17a9f5a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

public/js/bug-report.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@ BugReporter.prototype.report = function () {
3737
};
3838
window.addEventListener("load", function (event) {
3939

40-
function quoteText(text){
41-
return text.split("\n").map(function(line){
40+
function quoteText(text) {
41+
return text.split("\n").map(function (line) {
4242
return "> " + line;
4343
}).join("\n");
4444
}
45+
4546
var reportElement = document.createElement("button");
4647
reportElement.textContent = "バグ報告";
4748
reportElement.setAttribute("style", "position:fixed; right:0;bottom:0;");
48-
reportElement.addEventListener("click", function (event) {
49+
var clickEvent = ("ontouchstart" in window) ? "touchend" : "click";
50+
reportElement.addEventListener(clickEvent, function (event) {
4951
var bug = new BugReporter();
5052
var selectedText = bug.getSelectedText().trim();
51-
console.log(selectedText);
5253
var body = 'URL : ' + bug.getURLs() + "\n";
5354
if (selectedText && selectedText.length > 0) {
5455
body += "\n" + quoteText(selectedText) + "\n";

0 commit comments

Comments
 (0)