<commit_before>(function() {
    'use strict';

    class ToolbarCtrl {
        constructor($timeout, currentWindowService) {
            this.$timeout = $timeout;
            this.currentWindowService = currentWindowService;
            this.maximised = false;
            this.summarised = false;
            currentWindowService.ready(this.onReady.bind(this));
        }

        onReady() {
            this.window = this.currentWindowService.getCurrentWindow();
            this.window.getBounds(function(bounds) {
                if (bounds.width === 230) {
                    this.summarised = true;
                    this.window.summarised = true;
                }
                else {
                    this.window.summarised = false;
                }
            });
            this.window.addEventListener('maximized', () => {
                this.$timeout(() => {
                    this.maximised = true;
                });

                this.window.addEventListener('restored', function(e) {
                    this.$timeout(function() {
                        this.maximised = false;
                    });
                });
            });
            this.window.addEventListener('bounds-changed', (e) => {
                this.window.getBounds(function(bounds) {
                    if (bounds.width === 230) {
                        console.log('reached');
                        this.window.summarised = true;
                    }
                    else {
                        this.window.summarised = false;
                    }
                });
            });
        }

        minimiseClick() {
            this.window.minimize();
        }

        maximiseClick() {
            this.window.maximize();
        }

        normalSizeClick() {
            this.window.restore();
        }

        summariseClick() {<commit_msg>Fixes issue with restore going back to compact view rather than standard<commit_after>(function() {
    'use strict';

    class ToolbarCtrl {
        constructor($timeout, currentWindowService) {
            this.$timeout = $timeout;
            this.currentWindowService = currentWindowService;
            this.maximised = false;
            this.summarised = false;
            currentWindowService.ready(this.onReady.bind(this));
        }

        onReady() {
            this.window = this.currentWindowService.getCurrentWindow();
            this.window.getBounds(function(bounds) {
                if (bounds.width === 230) {
                    this.summarised = true;
                    this.window.summarised = true;
                }
                else {
                    this.window.summarised = false;
                }
            });
            this.window.addEventListener('maximized', () => {
                this.$timeout(() => {
                    this.maximised = true;
                });

                this.window.addEventListener('restored', function(e) {
                    this.$timeout(function() {
                        this.maximised = false;
                    });
                });
            });
            this.window.addEventListener('bounds-changed', (e) => {
                this.window.getBounds(function(bounds) {
                    if (bounds.width === 230) {
                        console.log('reached');
                        this.window.summarised = true;
                    }
                    else {
                        this.window.summarised = false;
                    }
                });
            });
        }

        minimiseClick() {
            this.window.minimize();
        }

        maximiseClick() {
            this.window.maximize();
        }

        normalSizeClick() {
            this.window.restore();
            this.window.resizeTo(1280, 720, 'top-right');
        }

        summariseClick() {
{'fraction_non_alphanumeric': 0.11068211068211069, 'fraction_numerical': 0.004890604890604891, 'mean_word_length': 1.1422271223814775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1344913', 'n_tokens_mistral': 967, 'n_tokens_neox': 893, 'n_words': 130}