Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* @module package/quiqqer/bricks/bin/Controls/backend/BrickSelectWindow
* @author www.pcsg.de (Henning Leutz)
*/
define('package/quiqqer/bricks/bin/Controls/backend/BrickSelectWindow', [
'qui/QUI',
'qui/controls/windows/Confirm',
'Locale'
], function (QUI, QUIConfirm, QUILocale) {
"use strict";
var lg = 'quiqqer/bricks';
return new Class({
Extends: QUIConfirm,
Type : 'package/quiqqer/bricks/bin/Controls/backend/BrickSelectWindow',
Binds: [
'$onOpen'
],
options: {
project: false,
lang : false
},
initialize: function (options) {
// defaults
this.setAttributes({
maxHeight: 800,
maxWidth : 800,
icon : 'fa fa-cubes',
title : QUILocale.get(lg, 'window.brick.select.title')
});
this.parent(options);
this.$BricksSelect = null;
this.addEvents({
onOpen: this.$onOpen
});
},
/**
* event: on open
*
* @param Win
*/
$onOpen: function (Win) {
var self = this;
Win.Loader.show();
Win.getContent().set('html', '');
require([
'package/quiqqer/bricks/bin/Controls/backend/BrickList'
], function (BrickList) {
self.$BricksSelect = new BrickList({
project : self.getAttribute('project'),
lang : self.getAttribute('lang'),
multiple: self.getAttribute('multiple'),
styles : {
height: '100%'
},
events : {
onDblClick: function () {
self.submit();
}
}
}).inject(Win.getContent());
Win.Loader.hide();
});
},
/**
* submit, fires onSubmit
*/
submit: function () {
this.fireEvent('submit', [this, this.$BricksSelect.getValue()]);
if (this.getAttribute('autoclose')) {
this.close();
}
}
});
});