<commit_before>/**
 * @ngdoc directive
 * @name refigureApp.directive:collectionsItem
 * @restrict E
 * @description
 * Single collection page
 * @example
 * <collections-item></collections-item>
 */
(function (angular) {
    'use strict';

    angular
        .module('refigureApp')
        .component('collectionsItem', {
            templateUrl: 'view/collectionsItem.component.html',
            controllerAs: 'vm',
            controller: ItemController
        });

    ItemController.$inject = [
        '$state',
        '$stateParams',
        'collections',
        'authUserInfo',
        'modalDialog'
    ];

    function ItemController($state, $stateParams, collections, authUserInfo, modal) {
        var vm = this;
        var currentLastInRow = -1;

        vm.refigure = null;
        vm.details = null;

        vm.imageDetails = imageDetails;
        vm.toggleFlag = toggleFlag;
        vm.isAdmin = isAdmin;
        vm.showFullScreen = showFullScreen;

        vm.$onInit = activate;

        ///////////////////////

        function activate() {
            $state.get('collections.item').data.headerTitle = '';
            collections
                .get($stateParams.id)
                .then(function (resp) {
                    $state.get('collections.item').data.headerTitle = '"' + resp.Title + '"';
                    vm.refigure = resp;
                    if (vm.refigure.Keywords) {
                        vm.refigure.KeywordsChips = vm.refigure.Keywords.split(/(?:(?:&[^;]+;)|\s|\||,|;)+/);
                    }
                });
        }

        function imageDetails(e, index) {
            var el = e.originalTarget,
                nextElement;
            if (el.tagName === 'IMG') {
                el = el.parentNode;
            }
            if (vm.details && vm.details.ID === vm.refigure.Figures[index].ID) {
                //close current
                currentLastInRow = -1;
                vm.refigure.Figures[index].lastInRow = false;
                vm.details = null;<commit_msg>~ chrome originalTarget issue fixed<commit_after>/**
 * @ngdoc directive
 * @name refigureApp.directive:collectionsItem
 * @restrict E
 * @description
 * Single collection page
 * @example
 * <collections-item></collections-item>
 */
(function (angular) {
    'use strict';

    angular
        .module('refigureApp')
        .component('collectionsItem', {
            templateUrl: 'view/collectionsItem.component.html',
            controllerAs: 'vm',
            controller: ItemController
        });

    ItemController.$inject = [
        '$state',
        '$stateParams',
        'collections',
        'authUserInfo',
        'modalDialog'
    ];

    function ItemController($state, $stateParams, collections, authUserInfo, modal) {
        var vm = this;
        var currentLastInRow = -1;

        vm.refigure = null;
        vm.details = null;

        vm.imageDetails = imageDetails;
        vm.toggleFlag = toggleFlag;
        vm.isAdmin = isAdmin;
        vm.showFullScreen = showFullScreen;

        vm.$onInit = activate;

        ///////////////////////

        function activate() {
            $state.get('collections.item').data.headerTitle = '';
            collections
                .get($stateParams.id)
                .then(function (resp) {
                    $state.get('collections.item').data.headerTitle = '"' + resp.Title + '"';
                    vm.refigure = resp;
                    if (vm.refigure.Keywords) {
                        vm.refigure.KeywordsChips = vm.refigure.Keywords.split(/(?:(?:&[^;]+;)|\s|\||,|;)+/);
                    }
                });
        }

        function imageDetails(e, index) {
            var el = e.target,
                nextElement;
            if (el.tagName === 'IMG') {
                el = el.parentNode;
            }
            if (vm.details && vm.details.ID === vm.refigure.Figures[index].ID) {
                //close current
                currentLastInRow = -1;
                vm.refigure.Figures[index].lastInRow = false;
                vm.details = null;
{'fraction_non_alphanumeric': 0.14177647632991702, 'fraction_numerical': 0.0009760858955588092, 'mean_word_length': 1.57960981749528, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3023557', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1111, 'n_words': 197}