• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

compassinformatics / cpsi-mapview / 15022980938

14 May 2025 02:11PM UTC coverage: 26.333% (+0.04%) from 26.29%
15022980938

push

github

geographika
Move describe to test globals

492 of 2344 branches covered (20.99%)

Branch coverage included in aggregate %.

1464 of 5084 relevant lines covered (28.8%)

1.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

10.0
/app/controller/window/MinimizableWindow.js
1
/**
2
 * This class is the controller for the MinimizableWindow.
3
 */
4
Ext.define('CpsiMapview.controller.window.MinimizableWindow', {
1✔
5
    extend: 'Ext.app.ViewController',
6

7
    alias: 'controller.cmv_minimizable_window',
8

9
    mixins: ['CpsiMapview.form.HelpMixin'],
10

11
    /**
12
     * Trigger the windowClosed to remove any associated toolbar
13
     * button if the window is closed
14
     */
15
    onClose: function () {
16
        const me = this;
×
17
        const minimizeTo = me.getMinimizeToolbar();
×
18
        if (minimizeTo) {
×
19
            minimizeTo.fireEvent('windowClosed', me.getView());
×
20
        }
21
    },
22

23
    /**
24
     * Placeholder function for adding in a hook when the window is hidden
25
     */
26
    onHide: Ext.emptyFn,
27

28
    /**
29
     * Sets the window invisible and calls the addMinimizedWindow event
30
     * of the related MinimizedWindows toolbar.
31
     */
32
    onMinimize: function () {
33
        const me = this;
×
34
        const minimizeTo = me.getMinimizeToolbar();
×
35
        if (minimizeTo == null) {
×
36
            Ext.log({
×
37
                msg: 'No cmv_minimized_windows_toolbar found. Window might just disappear.',
38
                level: 'warn'
39
            });
40
        }
41

42
        const win = me.getView();
×
43
        win.isMinimized = true;
×
44
        win.setVisible(false);
×
45
        if (minimizeTo) {
×
46
            minimizeTo.fireEvent('addMinimizedWindow', win);
×
47
        }
48
    },
49

50
    /**
51
     * Helper function to get the right MinimizedWindows toolbar.
52
     * If defined, returns me.getView().minimizeTo, else checks for
53
     * any MinimizedWindows toolbar and returns first match. If no
54
     * toolbar found, returns undefined
55
     */
56
    getMinimizeToolbar: function () {
57
        const me = this;
×
58
        let minimizeTo = me.getView().minimizeTo;
×
59
        if (minimizeTo == null) {
×
60
            const toolbars = Ext.ComponentQuery.query(
×
61
                'cmv_minimized_windows_toolbar'
62
            );
63
            if (toolbars.length > 0) {
×
64
                minimizeTo = toolbars[0];
×
65
            }
66
        }
67
        return minimizeTo;
×
68
    },
69

70
    /**
71
     * Fires the restoreFromWindow event if window is currently minimized
72
     */
73
    onShow: function () {
74
        const me = this;
1✔
75
        if (me.getView().isMinimized) {
1!
76
            const minimizeTo = me.getMinimizeToolbar();
×
77
            if (minimizeTo) {
×
78
                minimizeTo.fireEvent('restoreFromWindow', me.getView());
×
79
            }
80
        }
81
    }
82
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc