Commit 3e9deb740b0802a5ccaa149838acdb3d8308c63e

Authored by Amrita Vishnoi
2 parents 2e475c94 ae794cde

Merge branch 'LexiconIssue' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -3857,6 +3857,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3857,6 +3857,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3857 $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language }); 3857 $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
3858 } 3858 }
3859 }); 3859 });
  3860 +
  3861 + if ($rootScope.lexiconRemovedLanguage[i].language == $("#primarylaxican").val()) {
  3862 +
  3863 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  3864 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  3865 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  3866 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
  3867 + $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>');
  3868 + $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
  3869 + $("#lexiconLangDropdown option").each(function () {
  3870 + if($rootScope.lexiconPrimaryLanguage == $(this).val()){
  3871 + $(this).remove();
  3872 + }
  3873 + });
  3874 + }
  3875 +
  3876 + //$("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  3877 + //$('#primarylaxican').attr("name", $rootScope.primaryLangID);
  3878 +
3860 } 3879 }
3861 } 3880 }
3862 else if (languageDifference < 0) { 3881 else if (languageDifference < 0) {
@@ -3873,24 +3892,36 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -3873,24 +3892,36 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3873 $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>'); 3892 $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>');
3874 $rootScope.lexiconLanguageArray.pop(); 3893 $rootScope.lexiconLanguageArray.pop();
3875 } 3894 }
  3895 +
  3896 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  3897 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  3898 + $("#lexiconLangDropdown option").each(function () {
  3899 + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
  3900 + $(this).remove();
  3901 + }
  3902 + })
  3903 + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
  3904 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  3905 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
3876 } 3906 }
3877 3907
3878 -  
3879 - if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {  
3880 - // alert("same name");  
3881 - }  
3882 - else {  
3883 - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;  
3884 - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;  
3885 - $("#lexiconLangDropdown option").each(function () {  
3886 - if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {  
3887 - $(this).remove(); 3908 + else if (languageDifference == 0) {
  3909 + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
  3910 + // alert("same name");
3888 } 3911 }
3889 - })  
3890 - $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');  
3891 - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);  
3892 - $('#primarylaxican').attr("name", $rootScope.primaryLangID);  
3893 - } 3912 + else {
  3913 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  3914 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  3915 + $("#lexiconLangDropdown option").each(function () {
  3916 + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
  3917 + $(this).remove();
  3918 + }
  3919 + })
  3920 + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
  3921 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  3922 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
  3923 + }
  3924 + }
3894 } 3925 }
3895 3926
3896 3927