Commit e0c33846e2d7d1d438210ef3778f4a439c38af7b
1 parent
184d8855
23771 : Settings > Lexicons > Duplicate lexicon are appear.
Showing
1 changed file
with
18 additions
and
13 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -4041,7 +4041,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -4041,7 +4041,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
4041 | 4041 | ||
4042 | $rootScope.deSelectLanguageOptions = function () { | 4042 | $rootScope.deSelectLanguageOptions = function () { |
4043 | 4043 | ||
4044 | - var languageDifference = ($rootScope.lexiconLanguageArrayLength) - ($rootScope.lexiconLanguageArray.length); | 4044 | + var languageDifference = ($rootScope.lexiconLanguageArrayLength) - ($rootScope.lexiconLanguageArray.length); |
4045 | + languageDifference = parseInt(languageDifference); | ||
4045 | if (languageDifference > 0) { | 4046 | if (languageDifference > 0) { |
4046 | for (var i = 0; i <= $rootScope.lexiconRemovedLanguage.length - 1; i++) { | 4047 | for (var i = 0; i <= $rootScope.lexiconRemovedLanguage.length - 1; i++) { |
4047 | $("#lexiconLangDropdown option").each(function () { | 4048 | $("#lexiconLangDropdown option").each(function () { |
@@ -4086,19 +4087,23 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -4086,19 +4087,23 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
4086 | $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>'); | 4087 | $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>'); |
4087 | $rootScope.lexiconLanguageArray.pop(); | 4088 | $rootScope.lexiconLanguageArray.pop(); |
4088 | } | 4089 | } |
4089 | - | ||
4090 | - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; | ||
4091 | - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; | ||
4092 | - $("#lexiconLangDropdown option").each(function () { | ||
4093 | - if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { | ||
4094 | - $(this).remove(); | ||
4095 | - } | ||
4096 | - }) | ||
4097 | - $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>'); | ||
4098 | - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); | ||
4099 | - $('#primarylaxican').attr("name", $rootScope.primaryLangID); | 4090 | + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { |
4091 | + } | ||
4092 | + else | ||
4093 | + { | ||
4094 | + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; | ||
4095 | + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; | ||
4096 | + $("#lexiconLangDropdown option").each(function () { | ||
4097 | + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { | ||
4098 | + $(this).remove(); | ||
4099 | + } | ||
4100 | + }) | ||
4101 | + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>'); | ||
4102 | + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); | ||
4103 | + $('#primarylaxican').attr("name", $rootScope.primaryLangID); | ||
4104 | + } | ||
4100 | } | 4105 | } |
4101 | - | 4106 | + |
4102 | else if (languageDifference == 0) { | 4107 | else if (languageDifference == 0) { |
4103 | if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { | 4108 | if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { |
4104 | // alert("same name"); | 4109 | // alert("same name"); |