<commit_before>// -------------------------------------------------------------------------- \\
// File: SplitViewDivider.js                                                  \\
// Module: View                                                               \\
// Requires: Core, Foundation, DOM, View.js, SplitView.js, Draggable.js       \\
// Author: <NAME>                                                       \\
// License: © 2010–2012 Opera Software ASA. All rights reserved.              \\
// -------------------------------------------------------------------------- \\

/*global O */

"use strict";

( function ( NS ) {

var SplitDividerView = NS.Class({
    
    Extends: NS.View,
    
    Mixin: NS.Draggable,

    thickness: 10,
    
    length: new NS.Binding({
        isTwoWay: true
    }).from( 'parentView.staticPaneLength' ),
    
    min: NS.bind( 'parentView.minStaticPaneLength' ),
    max: NS.bind( 'parentView.maxStaticPaneLength' ),
    
    direction: NS.bind( 'parentView.direction' ),
    flex: NS.bind( 'parentView.flex' ),
    
    anchor: function () {
        var flexTL = this.get( 'flex' ) === NS.SplitView.TOP_LEFT,
            isVertical = this.get( 'direction' ) === NS.SplitView.VERTICAL;
        return isVertical ?
            ( flexTL ? 'right' : 'left' ) : ( flexTL ? 'bottom' : 'top' );
    }.property( 'flex', 'direction' ),
        
    positioning: 'absolute',
    
    layout: function () {
        var thickness = this.get( 'thickness' ),
            styles;
        if ( this.get( 'direction' ) === NS.SplitView.VERTICAL ) {
            styles = {
                top: 0,
                bottom: 0,
                width: thickness
            };
        } else {
            styles = {
                left: 0,
                right: 0,
                height: thickness
            };
        }
        styles[ this.get( 'anchor' ) ] =
            this.get( 'length' ) - ( thickness / 2 );
        return styles;
    }.property( 'direction', 'anchor', 'thickness', 'length' ),
    
    dragStarted: function ( drag ) {
        this._length = this.get( 'length' );
        this._dir = ( this.get( 'direction' ) === NS.SplitView.VERTICAL ) ?
            'x' : 'y';
    },
    
    dragMoved: function ( drag ) {
        var dir = this._dir,
            delta = drag.get( 'cursorLocation' )[ dir ] -
                drag.get( 'startLocation' )[ dir ];
        this.set( 'length', ( this._length + delta ).limit(
            this.get( 'min' ), this.get( 'max' ) ) );
    }
});

NS.SplitDividerView = SplitDividerView;

}( O ) ); // End SplitView closure.<commit_msg>Add class name to layer in SplitDividerView.<commit_after>// -------------------------------------------------------------------------- \\
// File: SplitViewDivider.js                                                  \\
// Module: View                                                               \\
// Requires: Core, Foundation, DOM, View.js, SplitView.js, Draggable.js       \\
// Author: <NAME>                                                       \\
// License: © 2010–2012 Opera Software ASA. All rights reserved.              \\
// -------------------------------------------------------------------------- \\

/*global O */

"use strict";

( function ( NS ) {

var SplitDividerView = NS.Class({
    
    Extends: NS.View,
    
    Mixin: NS.Draggable,
    
    className: 'SplitDividerView',

    thickness: 10,
    
    length: new NS.Binding({
        isTwoWay: true
    }).from( 'parentView.staticPaneLength' ),
    
    min: NS.bind( 'parentView.minStaticPaneLength' ),
    max: NS.bind( 'parentView.maxStaticPaneLength' ),
    
    direction: NS.bind( 'parentView.direction' ),
    flex: NS.bind( 'parentView.flex' ),
    
    anchor: function () {
        var flexTL = this.get( 'flex' ) === NS.SplitView.TOP_LEFT,
            isVertical = this.get( 'direction' ) === NS.SplitView.VERTICAL;
        return isVertical ?
            ( flexTL ? 'right' : 'left' ) : ( flexTL ? 'bottom' : 'top' );
    }.property( 'flex', 'direction' ),
    
    positioning: 'absolute',
    
    layout: function () {
        var thickness = this.get( 'thickness' ),
            styles;
        if ( this.get( 'direction' ) === NS.SplitView.VERTICAL ) {
            styles = {
                top: 0,
                bottom: 0,
                width: thickness
            };
        } else {
            styles = {
                left: 0,
                right: 0,
                height: thickness
            };
        }
        styles[ this.get( 'anchor' ) ] =
            this.get( 'length' ) - ( thickness / 2 );
        return styles;
    }.property( 'direction', 'anchor', 'thickness', 'length' ),
    
    dragStarted: function ( drag ) {
        this._length = this.get( 'length' );
        this._dir = ( this.get( 'direction' ) === NS.SplitView.VERTICAL ) ?
            'x' : 'y';
    },
    
    dragMoved: function ( drag ) {
        var dir = this._dir,
            delta = drag.get( 'cursorLocation' )[ dir ] -
                drag.get( 'startLocation' )[ dir ];
        this.set( 'length', ( this._length + delta ).limit(
            this.get( 'min' ), this.get( 'max' ) ) );
    }
});

NS.SplitDividerView = SplitDividerView;

}( O ) ); // End SplitView closure.
{'fraction_non_alphanumeric': 0.1934934745602421, 'fraction_numerical': 0.005674295441649328, 'mean_word_length': 1.2530890498508735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1080796', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1436, 'n_words': 329}