diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 2436c65..807fe01 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -3857,6 +3857,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language }); } }); + + if ($rootScope.lexiconRemovedLanguage[i].language == $("#primarylaxican").val()) { + + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); + $('#primarylaxican').attr("name", $rootScope.primaryLangID); + $('#secondLax').append(''); + $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language }); + $("#lexiconLangDropdown option").each(function () { + if($rootScope.lexiconPrimaryLanguage == $(this).val()){ + $(this).remove(); + } + }); + } + + //$("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); + //$('#primarylaxican').attr("name", $rootScope.primaryLangID); + } } else if (languageDifference < 0) { @@ -3873,24 +3892,36 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $('#lexiconLangDropdown').append(''); $rootScope.lexiconLanguageArray.pop(); } + + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; + $("#lexiconLangDropdown option").each(function () { + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { + $(this).remove(); + } + }) + $('#lexiconLangDropdown').append(''); + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); + $('#primarylaxican').attr("name", $rootScope.primaryLangID); } - - if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { - // alert("same name"); - } - else { - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; - $("#lexiconLangDropdown option").each(function () { - if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { - $(this).remove(); + else if (languageDifference == 0) { + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { + // alert("same name"); } - }) - $('#lexiconLangDropdown').append(''); - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); - $('#primarylaxican').attr("name", $rootScope.primaryLangID); - } + else { + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; + $("#lexiconLangDropdown option").each(function () { + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { + $(this).remove(); + } + }) + $('#lexiconLangDropdown').append(''); + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); + $('#primarylaxican').attr("name", $rootScope.primaryLangID); + } + } }