Initial commit
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
<div class="CDB-ListDecoration-itemLink u-flex u-justifySpace u-alignCenter u-actionTextColor <% if (isSelected) { %> is-selected <% } %>">
|
||||
<%- _t('form-components.editors.fill.quantification.methods.' + name) %>
|
||||
</div>
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
var CoreView = require('backbone/core-view');
|
||||
var CustomListView = require('builder/components/custom-list/custom-view');
|
||||
var CustomListCollection = require('builder/components/custom-list/custom-list-collection');
|
||||
var ColumnListViewTemplate = require('builder/components/custom-list/column-list/column-list-view.tpl');
|
||||
|
||||
module.exports = CoreView.extend({
|
||||
defaults: {
|
||||
headerTitle: ''
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .js-back': '_onClickBack'
|
||||
},
|
||||
|
||||
initialize: function (opts) {
|
||||
if (!opts.stackLayoutModel) throw new Error('stackLayoutModel is required');
|
||||
if (!opts.columns) throw new Error('columns param is required');
|
||||
|
||||
this._stackLayoutModel = opts.stackLayoutModel;
|
||||
this._columns = opts.columns;
|
||||
this._showSearch = opts.showSearch || false;
|
||||
this._typeLabel = opts.typeLabel;
|
||||
this._itemTemplate = opts.itemTemplate;
|
||||
|
||||
this.collection = new CustomListCollection(this._columns);
|
||||
this.listenTo(this.collection, 'change:selected', this._onSelectItem);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.clearSubViews();
|
||||
this.$el.empty();
|
||||
|
||||
this.$el.append(
|
||||
ColumnListViewTemplate({
|
||||
headerTitle: this.options.headerTitle
|
||||
})
|
||||
);
|
||||
|
||||
this._initViews();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_onClickBack: function (e) {
|
||||
this.killEvent(e);
|
||||
this.trigger('back', this);
|
||||
},
|
||||
|
||||
_initViews: function () {
|
||||
this._listView = new CustomListView({
|
||||
collection: this.collection,
|
||||
showSearch: this._showSearch,
|
||||
typeLabel: this._typeLabel,
|
||||
itemTemplate: this._itemTemplate
|
||||
});
|
||||
this.$('.js-content').append(this._listView.render().$el);
|
||||
this.addView(this._listView);
|
||||
},
|
||||
|
||||
_onSelectItem: function (item) {
|
||||
this.trigger('selectItem', item, this);
|
||||
}
|
||||
});
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<% if (headerTitle) { %>
|
||||
<div class="CDB-Box-modalHeader">
|
||||
<ul class="CDB-Box-modalHeaderItem CDB-Box-modalHeaderItem--block CDB-Box-modalHeaderItem--paddingHorizontal">
|
||||
<li class="CDB-ListDecoration-item CDB-ListDecoration-itemPadding--vertical CDB-Text CDB-Size-medium u-secondaryTextColor">
|
||||
<button class="u-actionTextColor js-back u-rSpace">
|
||||
<i class="CDB-IconFont CDB-IconFont-arrowPrev Size-large"></i>
|
||||
</button>
|
||||
<%- headerTitle%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="js-content"></div>
|
||||
Reference in New Issue
Block a user