Skip to content

Commit

Permalink
VCST-2401: use ui-scroll-drop-down instead of ui-select (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
basilkot authored Dec 5, 2024
1 parent 93570cb commit f001d2e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module('virtoCommerce.pricingModule')
.controller('virtoCommerce.pricingModule.catalogSelectorController', ['$scope', 'virtoCommerce.catalogModule.catalogs', function ($scope, catalogs) {
catalogs.search({ take: 1000 }, function (result) {
$scope.catalogs = angular.copy(result.results);
});
$scope.blade.fetchCatalogs = function (criteria) {
return catalogs.search(criteria);
}
}]);
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="form-input" ng-controller="virtoCommerce.pricingModule.catalogSelectorController">
<ui-select multiple ng-model="blade.currentEntity.catalogIds">
<ui-select-match placeholder="{{'pricing.selectors.placeholders.catalog-lists' | translate}}">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="x.id as x in catalogs | filter: { name: $select.search }">
<span ng-bind-html="x.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
<ui-scroll-drop-down multiple ng-model="blade.currentEntity.catalogIds"
data="blade.fetchCatalogs(criteria)"
placeholder="'pricing.selectors.placeholders.catalog-lists'">
</ui-scroll-drop-down>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module('virtoCommerce.pricingModule')
.controller('virtoCommerce.pricingModule.pricelistSelectorController', ['$scope', 'virtoCommerce.pricingModule.pricelists', function ($scope, pricelists) {
pricelists.search({ take: 1000 }, function (result) {
$scope.pricelists = result.results;
});
$scope.blade.fetchPricelists = function (criteria) {
return pricelists.search(criteria);
};
}]);
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="form-input" ng-controller="virtoCommerce.pricingModule.pricelistSelectorController">
<ui-select multiple ng-model="blade.currentEntity.pricelistIds">
<ui-select-match placeholder="{{'pricing.selectors.placeholders.price-lists' | translate}}">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="x.id as x in pricelists | filter: { name: $select.search }">
<span ng-bind-html="x.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
<ui-scroll-drop-down multiple ng-model="blade.currentEntity.pricelistIds"
data="blade.fetchPricelists(criteria)"
placeholder="'pricing.selectors.placeholders.price-lists'">
</ui-scroll-drop-down>
</div>

0 comments on commit f001d2e

Please sign in to comment.