Dave Workman
2017-12-22 de20528938cc3fd5edf41c62cb8c97d30c6999d8
added touch support.
1 files modified
10 ■■■■■ changed files
src/TimeView.js 10 ●●●●● patch | view | raw | blame | history
src/TimeView.js
@@ -59,9 +59,9 @@
                }
            }
            return React.createElement('div', { key: type, className: 'rdtCounter' }, [
                React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),
                React.createElement('span', { key: 'up', className: 'rdtBtn', onTouchStart: this.onStartClicking('increase', type), onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),
                React.createElement('div', { key: 'c', className: 'rdtCount' }, value ),
                React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )
                React.createElement('span', { key: 'do', className: 'rdtBtn', onTouchStart: this.onStartClicking('decrease', type), onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )
            ]);
        }
        return '';
@@ -69,9 +69,9 @@
    renderDayPart: function() {
        return React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [
            React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),
            React.createElement('span', { key: 'up', className: 'rdtBtn', onTouchStart: this.onStartClicking('toggleDayPart', 'hours'), onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),
            React.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ),
            React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )
            React.createElement('span', { key: 'do', className: 'rdtBtn', onTouchStart: this.onStartClicking('toggleDayPart', 'hours'), onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )
        ]);
    },
@@ -181,9 +181,11 @@
                clearInterval( me.increaseTimer );
                me.props.setTime( type, me.state[ type ] );
                document.body.removeEventListener( 'mouseup', me.mouseUpListener );
                document.body.removeEventListener( 'touchend', me.mouseUpListener );
            };
            document.body.addEventListener( 'mouseup', me.mouseUpListener );
            document.body.addEventListener( 'touchend', me.mouseUpListener );
        };
    },