utubo / firefox-simple_gesture

🦊An add-on that adds simple touch gestures for Firfox for Android. Sorry, I only check issues sometimes.
https://addons.mozilla.org/ja/firefox/addon/simple-gesture/
Other
29 stars 1 forks source link

content.jsからoptions.js関係の処理を削除したい #43

Closed utubo closed 4 years ago

utubo commented 6 years ago

一度removeEventListenerして、以下に置き換えればけるかなぁ? toastは作成されてない場合があるからそこ直さないとだめか

{
    start: e => {
        SimpleGesture.onTouchStart(e);
        if (!target) return;
        e.preventDefault(); 
        // When editing gesture, don't timeout and don't display inputed command.
        SimpleGesture.clearGestureTimeoutTimer();
        document.getElementsById('simple_gesture_toast').classList.add('hide');
    },
    move: e => {
        SimpleGesture.onTouchMove(e);
        if (!target) return;
        e.preventDefault();
        if (gesture.length > SimpleGesture.MAX_LENGTH) {
            inputedGesture.classList.add('canceled');
        }
        // display inputed gesture.
        inputedGesture.textContent = gesture.substring(0, MAX_LENGTH);
        let d = SimpleGesture.ini.gestures[inputedGesture.textContent];
        d = (d && d !== target.name) ? `\u00a0(${getMessage(d)})` : '';
        dupName.textContent = d;
        toggleClass(d, 'dup', inputedGesture);
    },
    end: e => {
        if (!target) {
            SimpleGesture.onTouchEnd(e);
            return;
        }
        e.preventDefault(); 
        document.getElementsById('simple_gesture_toast').classList.remove('hide');
        if (inputedGesture.classList.contains('canceled')) {
            history.back();
        } else {
            updateGesture(gesture.substring(0, MAX_LENGTH));
        }
    }
}
utubo commented 4 years ago

プロジェクトの方で管理 https://github.com/utubo/firefox-simple_gesture/projects/2 このissueに連携させてもいいけどそれだと当分closeできなそうなのでもうこのissueは一旦closeしちゃう。 メモりたいことができたら復活&連携させるかも。