From 47bbb91e4a1986327c213a24af411bc60863fd33 Mon Sep 17 00:00:00 2001 From: Tigran Petrosyan Date: Mon, 17 Dec 2018 17:48:24 +0200 Subject: [PATCH] va-property2 - hidden languages (#186) * Done * null checks for hidden languages * markup fix --- .../Scripts/directives/property2.js | 11 +++++++++++ .../Scripts/directives/property2.tpl.html | 14 +++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.js b/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.js index 6802468ff..3c198a053 100644 --- a/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.js +++ b/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.js @@ -9,6 +9,7 @@ angular.module('virtoCommerce.catalogModule') templateUrl: 'Modules/$(VirtoCommerce.Catalog)/Scripts/directives/property2.tpl.html', scope: { languages: "=", + hiddenLanguages: "=", defaultLanguage: "=", getPropValues: "&", pageSize: "@?" @@ -130,6 +131,16 @@ angular.module('virtoCommerce.catalogModule') } }; + scope.isLanguageVisible = function (language) { + if(scope.hiddenLanguages){ + if (_.contains(scope.hiddenLanguages, language)) { + return false; + } + } + + return true; + } + scope.loadDictionaryValues = function ($select) { $select.page = 0; scope.context.allDictionaryValues = []; diff --git a/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.tpl.html b/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.tpl.html index 070f063d5..c6081f1a4 100644 --- a/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.tpl.html +++ b/VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.tpl.html @@ -178,7 +178,7 @@