commit aec4c4af8bdb2d48169940041c51070d67b19a70
parent 5a14305cd9819ecaff459890c216db0f01a09bb6
Author: Felicia Hummel <felicitus@felicitus.org>
Date: Tue, 2 Aug 2016 21:38:26 +0200
Merge pull request #703 from partkeepr/PartKeepr-509
Added proper selection handling when selecting thumbnail images
Diffstat:
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js
@@ -151,6 +151,16 @@ Ext.define('PartKeepr.PartManager', {
}
});
+ this.thumbnailView.on("selectionchange", function (selModel, selection) {
+ var parts = [];
+
+ for (var i = 0; i < selection.length; i++) {
+ parts.push(selection[i].get("part"));
+ }
+
+ this.grid.getSelectionModel().select(parts);
+ }, this);
+
this.grid.store.on("load", function () {
this.thumbnailView.getStore().removeAll();
@@ -164,7 +174,11 @@ Ext.define('PartKeepr.PartManager', {
for (j = 0; j < attachments.getCount(); j++) {
attachment = attachments.getAt(j);
if (attachment.get("isImage")) {
- this.thumbnailView.getStore().add(attachment)
+ this.thumbnailView.getStore().add({
+ "@id": attachment.get("@id"),
+ "part": data.getAt(i)
+ });
+
}
}
}
@@ -181,7 +195,7 @@ Ext.define('PartKeepr.PartManager', {
enableOverflow: true,
dock: 'bottom',
displayInfo: false,
- items: [{xtype: 'tbfill'},{
+ items: [{xtype: 'tbfill'}, {
xtype: 'tbtext',
itemId: "thumbnailViewStatusMessage"
}