blob: ad7820b8e8de457effbfbe913e309a6bb2485b98 (
plain)
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
|
define([
'templates/coding-rules'
], function () {
return Marionette.ItemView.extend({
template: Templates['coding-rules-rule-parameters'],
modelEvents: {
'change': 'render'
},
onRender: function () {
this.$el.toggleClass('hidden', _.isEmpty(this.model.get('params')));
},
serializeData: function () {
var isEditable = this.options.app.canWrite && (this.model.get('isManual') || this.model.get('isCustom'));
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
isEditable: isEditable,
canWrite: this.options.app.canWrite
});
}
});
});
|