<commit_before>app.directive('orgChart', function () {
    return {
        restrict: 'AE',
        scope: {
            orgOptions: '=',
            onChange : '&'
        },
        link: function (scope, element, attrs, ngModelCtrl) {
            $(element).orgchart(scope.orgOptions)
                .on('click', '.node', function() {
                    var $this = $(this);
                    $('#selected-node').val($this.find('.title').text()).data('node', $this);
                })<commit_msg>default option for dragging fro org chart<commit_after>app.directive('orgChart', function () {
    return {
        restrict: 'AE',
        scope: {
            orgOptions: '=',
            onChange : '&'
        },

        link: function (scope, element, attrs, ngModelCtrl) {
            var option = {};

            for(key in scope.orgOptions) {
                option[key] = scope.orgOptions[key];
            }

            if(scope.orgOptions.draggable) {
                option.dropCriteria = scope.orgOptions.dropCriteria ? scope.orgOptions.dropCriteria : dragbble;
            }

            function dragbble($draggedNode, $dragZone, $dropZone) {
                if ($draggedNode.find('.content').text().indexOf('manager') > -1 && $dropZone.find('.content').text().indexOf('engineer') > -1) {
                    return false;
                }
                return true;
            }
                (element).orgchart(option)
                 .children('.orgchart').on('nodedropped.orgchart', function (event) {
                    console.log('draggedNode:' + event.draggedNode.children('.title').text(), event.draggedNode.attr('id')
                    + ', dragZone:' + event.dragZone.children('.title').text(), event.dragZone.attr('id')
                    + ', dropZone:' + event.dropZone.children('.title').text(), event.dropZone.attr('id'));
                    var tree = $(element).orgchart('getHierarchy');
                    scope.onChange({hierarchy : tree});
                })
                .on('click', '.node', function() {
                    var $this = $(this);
                    $('#selected-node').val($this.find('.title').text()).data('node', $this);
                })
{'fraction_non_alphanumeric': 0.1654643823264202, 'fraction_numerical': 0.0009017132551848512, 'mean_word_length': 1.6962332928311057, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2327592', 'n_tokens_mistral': 595, 'n_tokens_neox': 576, 'n_words': 94}