Completed
Pull Request — develop (#179)
by Wachter
13:33
created

main.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
nc 1
nop 0
1
/*
2
 * This file is part of Sulu.
3
 *
4
 * (c) MASSIVE ART WebServices GmbH
5
 *
6
 * This source file is subject to the MIT license that is bundled
7
 * with this source code in the file LICENSE.
8
 */
9
10
define(['jquery'], function($) {
11
12
    'use strict';
13
14
    return {
15
16
        defaults: {
17
            options: {
18
                pages: []
19
            },
20
            translations: {
21
                orderPage: 'sulu_article.edit.order-page'
22
            }
23
        },
24
25
        initialize: function() {
26
            this.$container = $('<div/>');
27
            this.$componentContainer = $('<div/>');
28
29
            this.$el.append(this.$container);
30
31
            this.sandbox.start(
32
                [
33
                    {
34
                        name: 'overlay@husky',
35
                        options: {
36
                            el: this.$container,
37
                            instanceName: 'page-order',
38
                            openOnStart: true,
39
                            removeOnClose: true,
40
                            skin: 'medium',
41
                            slides: [
42
                                {
43
                                    title: this.translations.orderPage,
44
                                    data: this.$componentContainer,
45
                                    okCallback: function() {
46
                                    }
47
                                }
48
                            ]
49
                        }
50
                    }
51
                ]
52
            );
53
54
            this.sandbox.once('husky.overlay.page-order.opened', function() {
55
                this.sandbox.start([{
56
                    name: 'articles/edit/page-order/page-grid@suluarticle',
57
                    options: {
58
                        el: this.$componentContainer,
59
                        pages: this.options.pages
60
                    }
61
                }]);
62
            }.bind(this));
63
        }
64
    }
65
});
66