commit ea10f5bfc714c61a0c2f379e5ab926c59da0d94c
parent a60ba519ac54d7f98e52d37ba5902b7c7ef21789
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 15 Nov 2015 15:47:00 +0100
Wait until the storage location category tree is loaded, removed test function
Diffstat:
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/StorageLocationPicker.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/StorageLocationPicker.js
@@ -135,8 +135,14 @@ Ext.define("PartKeepr.StorageLocationPicker", {
},
onTypeAhead: function (newValue)
{
+ var picker = this.getPicker();
+
+ if (picker.getTree().getStore().isLoading()) {
+ Ext.defer(this.onTypeAhead, 200, this, [newValue]);
+ return;
+ }
+
if (newValue !== this.textValue) {
- var picker = this.getPicker();
picker.setCategoryFilter(picker.getTree().getRootNode().firstChild);
picker.getTree().getSelectionModel().select(picker.getTree().getRootNode().firstChild);
picker.setSearchValue(newValue);
@@ -177,18 +183,6 @@ Ext.define("PartKeepr.StorageLocationPicker", {
return errors;
},
- asdisValid: function () {
- if (!this.inputEl) {
- return false;
- }
-
- if (this.selectedStorageLocation instanceof PartKeepr.StorageLocationBundle.Entity.StorageLocation &&
- this.inputEl.getValue() === this.selectedStorageLocation.get("name")) {
- return true;
- } else {
- return false;
- }
- },
/**
* Creates and returns the tree panel to be used as this field's picker.
*/