<commit_before>/**
 * Created by KevinSo on 8/6/2014.
 */

'use strict';

angular.module('galleries')
    .directive("hideMe", function($animate) {
        return function(scope, element, attrs) {
            scope.$watch(attrs.hideMe, function(newVal) {
                if (newVal) {
                    $animate.addClass(element, "fade")
                } else {
                    $animate.removeClass(element, "fade")
                }
            })
        }
    })
    .directive("expandMe", function($animate){
        return function(scope, element, attrs) {
            scope.$watch(attrs.expandMe, function(newVal) {
                if (newVal) {
                    $animate.addClass(element, "expand")
                } else {
                    $animate.removeClass(element, "expand")
                }
            })
        }
    })
    .directive('menulist', ['$animate',
        function($animate) {
            return {
                restrict: 'E',
                scope: {
                    'source': '=',
                    'picture':'='
                },
                templateUrl: '/modules/galleries/directives/menulist/menulist.html',
                link: function(scope, element, attr, ctrl) {

                    scope.$watch(attr.hideMe, function(newVal) {
                        if (newVal) {
                            $animate.addClass(element, "fade")
                        } else {
                            $animate.removeClass(element, "fade")
                        }
                    })
                },
                controller: function($scope, $element){
                    $scope.isExpanded = false;
                    $scope.expandIt = function() {
                        $scope.isExpanded = !$scope.isExpanded;
                    }

                    console.log($element);

                    $element.bind('click', function(elem){
                        if($scope.picture===true) {
                            $scope.picture = false;
                            TweenMax.to(elem, 2, {opacity:0.1});
                        }
                        else {
                            $scope.picture = true;
                            TweenMax.to(elem, 2, {opacity:1});
                        }
                        $scope.$apply();
                    });
                }
            };
        }
    ])
    .animation('.fade', function() {
        return{
            addClass: function(element, className) {
                TweenMax.to(element, 2, {rotationY:"+=180", ease:Linear.easeNone});
                TweenMax.to(element, 1, {opacity: 0});
            },
            removeClass: function(element, className) {
                TweenMax.to(element, 2, {rotationY:"-=180", ease:Linear.easeNone});
                TweenMax.to(element, 1, {opacity: 1});
            }

        }
    })
    .animation('.expand', function() {
        return{
            addClass: function(element, className) {
                TweenMax.to(element, 1, {left:0});
                TweenMax.to(element, 1, {opacity: 1});
            },
            removeClass: function(element, className) {
                TweenMax.to(element, 1, {left:20});

            }<commit_msg>change boarderRadius<commit_after>/**
 * Created by KevinSo on 8/6/2014.
 */

'use strict';

angular.module('galleries')
    .directive("hideMe", function($animate) {
        return function(scope, element, attrs) {
            scope.$watch(attrs.hideMe, function(newVal) {
                if (newVal) {
                    $animate.addClass(element, "fade")
                } else {
                    $animate.removeClass(element, "fade")
                }
            })
        }
    })
    .directive("expandMe", function($animate){
        return function(scope, element, attrs) {
            scope.$watch(attrs.expandMe, function(newVal) {
                if (newVal) {
                    $animate.addClass(element, "expand")
                } else {
                    $animate.removeClass(element, "expand")
                }
            })
        }
    })
    .directive('menulist', ['$animate',
        function($animate) {
            return {
                restrict: 'E',
                scope: {
                    'source': '=',
                    'picture':'='
                },
                templateUrl: '/modules/galleries/directives/menulist/menulist.html',
                link: function(scope, element, attr, ctrl) {
                    TweenMax.to(element.children().children(), .75, {
                        //top-left and bottom-right | top-right and bottom-left
                        borderRadius:"0px 20px"
                    });
                    scope.$watch(attr.hideMe, function(newVal) {
                        if (newVal) {
                            $animate.addClass(element, "fade")
                        } else {
                            $animate.removeClass(element, "fade")
                        }
                    })
                },
                controller: function($scope, $element){
                    $scope.isExpanded = false;
                    $scope.expandIt = function() {
                        $scope.isExpanded = !$scope.isExpanded;
                    }

                    $element.bind('click', function(elem){
                        if($scope.picture===true) {
                            $scope.picture = false;
                            TweenMax.to(elem, 2, {opacity:0.1});
                        }
                        else {
                            $scope.picture = true;
                            TweenMax.to(elem, 2, {opacity:1});
                        }
                        $scope.$apply();
                    });
                }
            };
        }
    ])
    .animation('.fade', function() {
        return{
            addClass: function(element, className) {
                TweenMax.to(element, 2, {rotationY:"+=90", ease:Linear.easeNone});
                TweenMax.to(element, 2, {opacity: 0});
            },
            removeClass: function(element, className) {
                TweenMax.to(element, 2, {rotationY:"-=90", ease:Linear.easeNone});
                TweenMax.to(element, 2, {opacity: 1});
            }

        }
    })
    .animation('.expand', function() {
        return{
            addClass: function(element, className) {
                TweenMax.to(element, 1, {left:0});
                TweenMax.to(element, 1, {opacity: 1});
            },
            removeClass: function(element, className) {
                TweenMax.to(element, 1, {left:20});

            }
{'fraction_non_alphanumeric': 0.12818973281296908, 'fraction_numerical': 0.009456619633743621, 'mean_word_length': 1.1118858954041204, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7059067', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1629, 'n_words': 276}