<commit_before>/**
 * @author 
 */



Fx.TouchScroll = Class({
	
	constructor: function(dom, options){
        this.v = 0;
        this.y = 0;
        this.dom = dom;
        
        dom.on('mousedown', this.onMouseDown, this);
		
	},

    onMouseDown: function(e) {
        
        if (this.t) {
            clearInterval(this.t);
            this.t = 0;
        }
    
        this.y = e.pageY;
        this.v = 0;
        
        this.dom.un('mousedown', this.onMouseDown);
        this.dom.on('mousemove', this.onMouseMove, this);
        this.dom.on('mouseup', this.onMouseUp, this);
    },
    
    onMouseMove: function(e) {
        
        
    
        this.v = e.pageY - this.y;
        this.y = e.pageY;
        var child = this.dom;
        child.setScroll(null, child.getScroll().y + this.v);
        
        trace(child.getScroll().y + this.v);
        
    },
    
    onMouseUp: function(e) {
    
        var me = this;
        
        me.v *= 5;
        
        this.t = setInterval(function(){
            var child = me.dom;
            me.v /= 1.4;
            if (Math.abs(me.v) < 1) {
                clearInterval(me.t);
                me.t = 0;
            }
            child.setScroll(null, child.getScroll().y + me.v);
        }, 100);
    
        this.dom.on('mousedown', this.onMouseDown, this);
        this.dom.un('mousemove', this.onMouseMove);
        this.dom.un('mouseup', this.onMouseUp);
    },


});



Control.implement({
	
	touchScroll: function(options){
		return new 	Fx.TouchScroll(this,   options);	
	}

});<commit_msg>touchscroll<commit_after>/**
 * @author 
 */



Fx.TouchScroll = Class({
	
	constructor: function(dom, options){
        this.v = 0;
        this.y = 0;
        this.dom = dom;
        
        dom.on('mousedown', this.onMouseDown, this);
		
	},

    onMouseDown: function(e) {
        
        if (this.t) {
            clearInterval(this.t);
            this.t = 0;
        }
    
        this.y = e.pageY;
        this.v = 0;
        
        this.dom.un('mousedown', this.onMouseDown);
        this.dom.on('mousemove', this.onMouseMove, this);
        this.dom.on('mouseup', this.onMouseUp, this);
    },
    
    onMouseMove: function(e) {
        
        
    
        this.v = e.pageY - this.y;
        this.y = e.pageY;
        var child = this.dom;
        child.setScroll(null, child.getScroll().y + this.v);
        
    },
    
    onMouseUp: function(e) {
    
        var me = this;
        
        me.v *= 5;
        
        this.t = setInterval(function(){
            var child = me.dom;
            me.v /= 1.4;
            if (Math.abs(me.v) < 1) {
                clearInterval(me.t);
                me.t = 0;
            }
            child.setScroll(null, child.getScroll().y + me.v);
        }, 100);
    
        this.dom.on('mousedown', this.onMouseDown, this);
        this.dom.un('mousemove', this.onMouseMove);
        this.dom.un('mouseup', this.onMouseUp);
    },


});



Dom.implement({
	
	touchScroll: function(options){
		return new 	Fx.TouchScroll(this,   options);	
	}

});
{'fraction_non_alphanumeric': 0.15003240440699936, 'fraction_numerical': 0.007777057679844459, 'mean_word_length': 1.4079563182527302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2220262', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1046, 'n_words': 174}