<commit_before>angular.module('DarggableAngular', []).
        directive("dragButton", function () {
            return {
                restrict: "A",
                scope: {
                    onDragEnd: "&",
                    onDrag: "&"
                },
                link: function (scope, element) {
                    var gridWidth = 200;
                    var gridHeight = 100;
                    var zOriginal = 0;
                    function findHighestZIndex(elem) {
                        var elems = document.getElementsByTagName(elem);
                        var highest = 0;
                        for (var i = 0; i < elems.length; i++) {
                            var zindex = document.defaultView.getComputedStyle(elems[i], null).getPropertyValue("z-index");
                            if ((zindex > highest) && (zindex !== 'auto')) {
                                highest = zindex;
                            }
                        }
                        return highest;
                    }
                    Draggable.create(element, {
                        type: "x,y",
                        edgeResistance: 0.65,
                        bounds: "#draggableContainer",
                        throwProps: true,
                        snap: {
                            x: function (endValue) {
                                return Math.round(endValue / gridWidth) * gridWidth;
                            },
                            y: function (endValue) {
                                return Math.round(endValue / gridHeight) * gridHeight;
                            }
                        },
                        onDrag: function () {
                            scope.$apply(function () {
                                scope.onDrag(scope.draggableButton);
                            });
                        },
                        onDragEnd: function () {
                            scope.$apply(function () {
                                scope.onDragEnd({});
                            });
                        }
                    });
                }
            };
        });<commit_msg>Drag and Drop custom directive clean-up<commit_after>angular.module('DarggableAngular', []).
        directive("dragButton", function () {
            return {
                restrict: "A",
                scope: {
                    onDragEnd: "&",
                    onDrag: "&"
                },
                link: function (scope, element) {
                    var gridWidth = 200;
                    var gridHeight = 100;
                    var zOriginal = 0;
                    function findHighestZIndex(elem) {
                        var elems = document.getElementsByTagName(elem);
                        var highest = 0;
                        for (var i = 0; i < elems.length; i++) {
                            var zindex = document.defaultView.getComputedStyle(elems[i], null).getPropertyValue("z-index");
                            if ((zindex > highest) && (zindex !== 'auto')) {
                                highest = zindex;
                            }
                        }
                        return highest;
                    }
                    Draggable.create(element, {
                        type: "x,y",
                        edgeResistance: 0.65,
                        bounds: "#draggableContainer",
                        throwProps: true,
                        snap: {
                            x: function (endValue) {
                                return Math.round(endValue / gridWidth) * gridWidth;
                            },
                            y: function (endValue) {
                                return Math.round(endValue / gridHeight) * gridHeight;
                            }
                        },
                        onDrag: function () {
                            scope.$apply(function () {
                                scope.onDrag();
                            });
                        },
                        onDragEnd: function () {
                            scope.$apply(function () {
                                scope.onDragEnd();
                            });
                        }
                    });
                }
            };
        });
{'fraction_non_alphanumeric': 0.09034907597535935, 'fraction_numerical': 0.0054757015742642025, 'mean_word_length': 0.7058365758754864, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1921572', 'n_tokens_mistral': 971, 'n_tokens_neox': 879, 'n_words': 169}