-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReportDisplay.js
143 lines (115 loc) · 3.44 KB
/
ReportDisplay.js
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* jshint camelcase:false, unused:false, laxbreak:true, expr:true, boss:true */
/* globals debugger, BEMHTML, DEBUG, DBG, app, project */
/**
*
* @module ReportDisplay
* @overview __INFO__
*
* @author lilliputten <lilliputten@yandex.ru>
* @since 2017.06.02 18:37:17
* @version 2017.06.02 18:37:17
*
* $Date: 2017-06-22 15:21:55 +0300 (Чт, 22 июн 2017) $
* $Id: ReportDisplay.js 8619 2017-06-22 12:21:55Z miheev $
*
*/
modules.define('ReportDisplay', [
'nicescroll',
'i-bem-dom',
'vow',
'project',
'jquery',
],
function(provide,
nicescroll,
BEMDOM,
vow,
project,
$,
__BASE) {
/**
*
* @exports
* @class ReportDisplay
* @bem
* @classdesc __INFO__
*
* TODO
* ====
*
* ОПИСАНИЕ
* ========
*
*/
// Ссылка на описание модуля
var __module = this;
var ReportDisplay = /** @lends ReportDisplay.prototype */ {
/** exportData ** {{{ Экспортируем данные для печати/экспорта из объектов в созданном DOM
* @returns {Object}
*/
exportData : function (conditions) {
var exportables = this.findChildBlocks(BEMDOM.entity('exportable'));
var data = exportables
.map(function(exportable){
var providerType = exportable.getMod('provider'),
provider = providerType && exportable.findMixedBlock(BEMDOM.entity(providerType))
;
return provider || exportable;
})
.map(function(provider){
var data = provider;
if ( provider && typeof provider === 'object' ) {
if ( typeof provider.exportData === 'function' ) {
data = provider.exportData(conditions);
}
else if ( provider.params && provider.params.export ) {
data = provider.params.export;
}
}
return data;
})
.filter(function(data){
return data;
})
;
return data;
},/*}}}*/
/** _onInited() ** {{{ Инициализируем блок */
_onInited : function () {
var ReportDisplay = this,
that = this,
params = this.params,
undef
;
// this._actions();
// if ( !this.params.nicescroll ) {
// this.params.nicescroll = nicescroll.init(this);
// }
},/*}}}*/
/** onSetMod... ** {{{ События на установку модификаторов... */
onSetMod : {
/** (js:inited) ** {{{ Инициализация bem блока */
js : {
inited : function () {
var ReportDisplay = this,
that = this,
params = this.params,
undef
;
this._onInited();
},
},/*}}}*/
},/*}}}*/
};
provide(BEMDOM.declBlock(this.name, ReportDisplay, /** @lends ReportDisplay */{
// /** live() {{{ Lazy-инициализация.
// */
// live : function() {
//
// var ptp = this.prototype;
// // this.liveInitOnBlockInsideEvent('tree_toggle', 'menu-item', ptp._onTreeToggle);
//
// return this.__base.apply(this, arguments);
// }/*}}}*/
})); // provide
}); // module