2017-01-31 07:50:28 +01:00
|
|
|
const Backbone = require('backbone');
|
2015-11-21 15:55:42 +01:00
|
|
|
|
2017-01-31 07:50:28 +01:00
|
|
|
const ListWrapView = Backbone.View.extend({
|
2019-08-16 23:05:39 +02:00
|
|
|
events: {},
|
2015-11-21 15:55:42 +01:00
|
|
|
|
|
|
|
initialize: function() {
|
|
|
|
this.listenTo(this.model.settings, 'change:tableView', this.setListLayout);
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
this.setListLayout();
|
|
|
|
},
|
|
|
|
|
|
|
|
setListLayout: function() {
|
2017-01-31 07:50:28 +01:00
|
|
|
const tableView = this.model.settings.get('tableView');
|
2015-11-21 15:55:42 +01:00
|
|
|
this.$el.toggleClass('app__list-wrap--table', tableView);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = ListWrapView;
|