mirror of https://github.com/keeweb/keeweb.git
fix #272: save displayed table columns
This commit is contained in:
parent
f779809994
commit
f3e1ccdb3c
|
@ -26,6 +26,7 @@ var AppSettingsModel = Backbone.Model.extend({
|
|||
skipHttpsWarning: false,
|
||||
demoOpened: false,
|
||||
fontSize: 0,
|
||||
tableViewColumns: null,
|
||||
dropbox: true,
|
||||
webdav: true,
|
||||
gdrive: true,
|
||||
|
|
|
@ -57,6 +57,8 @@ var ListView = Backbone.View.extend({
|
|||
|
||||
this.listenTo(this.model.settings, 'change:tableView', this.setTableView);
|
||||
|
||||
this.readTableColumnsEnabled();
|
||||
|
||||
this.items = [];
|
||||
},
|
||||
|
||||
|
@ -266,6 +268,21 @@ var ListView = Backbone.View.extend({
|
|||
col.enabled = !col.enabled;
|
||||
e.el.find('i:first').toggleClass('fa-check-square-o fa-square-o');
|
||||
this.render();
|
||||
this.saveTableColumnsEnabled();
|
||||
},
|
||||
|
||||
readTableColumnsEnabled() {
|
||||
let tableViewColumns = AppSettingsModel.instance.get('tableViewColumns');
|
||||
if (tableViewColumns && tableViewColumns.length) {
|
||||
this.tableColumns.forEach(col => {
|
||||
col.enabled = tableViewColumns.indexOf(col.name) >= 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
saveTableColumnsEnabled() {
|
||||
let tableViewColumns = this.tableColumns.filter(column => column.enabled).map(column => column.name);
|
||||
AppSettingsModel.instance.set('tableViewColumns', tableViewColumns);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ Release notes
|
|||
`+` solarized themes
|
||||
`+` select field contents on search hotkey
|
||||
`+` option to preload default config
|
||||
`+` save displayed table columns
|
||||
`-` fix app redraw in background
|
||||
|
||||
##### v1.2.4 (2016-07-20)
|
||||
|
|
Loading…
Reference in New Issue