1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 17:47:08 +00:00

Fixed: Selecting range with shift-key in Series Editor should now work as intended.

This commit is contained in:
Taloth Saldono 2015-03-09 22:59:48 +01:00
parent f5f050f80b
commit 2a12aca66a
2 changed files with 11 additions and 8 deletions

View file

@ -4,14 +4,16 @@ var BackgridSelectAll = require('backgrid.selectall');
module.exports = BackgridSelectAll.extend({
enterEditMode : function(e) {
if (e.shiftKey && this.model.collection.lastToggled) {
this._selectRange();
var collection = this.column.get('sortedCollection') || this.model.collection;
if (e.shiftKey && collection.lastToggled) {
this._selectRange(collection);
}
var checked = $(e.target).prop('checked');
this.model.collection.lastToggled = this.model;
this.model.collection.checked = checked;
collection.lastToggled = this.model;
collection.checked = checked;
},
onChange : function(e) {
@ -20,8 +22,7 @@ module.exports = BackgridSelectAll.extend({
this.model.trigger('backgrid:selected', this.model, checked);
},
_selectRange : function() {
var collection = this.model.collection;
_selectRange : function(collection) {
var lastToggled = collection.lastToggled;
var checked = collection.checked;
@ -38,7 +39,7 @@ module.exports = BackgridSelectAll.extend({
model.trigger('backgrid:select', model, checked);
});
this.model.collection.lastToggled = undefined;
this.model.collection.checked = undefined;
collection.lastToggled = undefined;
collection.checked = undefined;
}
});

View file

@ -145,6 +145,8 @@ module.exports = Marionette.Layout.extend({
return;
}
this.columns[0].sortedCollection = this.seriesCollection;
this.editorGrid = new Backgrid.Grid({
collection : this.seriesCollection,
columns : this.columns,