マクロミル(SP版)マトリクスをロングタップで項目を閉じる

普通のタップなら普通に回答、ロングタップなら項目を閉じるので楽

// ==UserScript==
// @name         マクロミル(SP版)マトリクスをロングタップで項目を閉じる
// @namespace    macromill_matrixclose
// @version      0.0.2
// @description  普通のタップなら普通に回答、ロングタップなら項目を閉じるので楽
// @author       monitor_support
// @include      https://monitor.macromill.com/airs/exec/smartAnswerAction.do*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js
// @license     新UI作ったやつはうんちでも食べてろ
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';

	var matrixflg=0;
	var timerId;
	$('.qnr-q-ch-form, .rcnone, .radio').on("mousedown touchstart", function(){
		var elm=this;
		matrixflg=0;
		timerId = setTimeout(function(){
			matrixflg=1;
		}, 300);
	});
	$('.qnr-q-ch-form, .rcnone, .radio').on("mouseup touchend", function(){
		clearTimeout(timerId);
		if(matrixflg == 1) {
//			$(this).trigger("click");
			$(this).parent().parent().parent().parent().children(".matrix-item").trigger("click");
		}
		matrixflg=0;
	});
})();