Commit eb5929b2342af7f6adec485c1baaf54765609a57
conflicted merge
Showing
1 changed file
with
89 additions
and
10 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -507,13 +507,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
507 | 507 | $rootScope.secondlaxtext = $("#secondLax option:selected").text(); |
508 | 508 | |
509 | 509 | }); |
510 | - | |
510 | + | |
511 | 511 | $("#laxiconLangRemove").click(function () { |
512 | 512 | if ($rootScope.isActiveLexiconLanguageClicked == true) { |
513 | 513 | $rootScope.isActiveLexiconLanguageClicked = false; |
514 | 514 | $("#secondLax :selected").remove(); |
515 | 515 | $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>'); |
516 | - // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
516 | + // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
517 | 517 | $rootScope.lexiconLanguageArray = []; |
518 | 518 | $("#secondLax > option").each(function () { |
519 | 519 | $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value }); |
... | ... | @@ -1013,7 +1013,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
1013 | 1013 | $('#modal-settings').css("display", "block"); |
1014 | 1014 | $("#modelsettingsbackground").css("display", "block"); |
1015 | 1015 | } |
1016 | - | |
1016 | + | |
1017 | + $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length; | |
1018 | + $rootScope.lexiconPrimaryLanguage = $("#primarylaxican").val(); | |
1019 | + $rootScope.primaryLangID = $('#primarylaxican').attr("name"); | |
1017 | 1020 | } |
1018 | 1021 | |
1019 | 1022 | //----Annotation Toolbar: Jcanvas----- |
... | ... | @@ -3434,41 +3437,114 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3434 | 3437 | $rootScope.setModestySettings(formsetting.modesty); |
3435 | 3438 | |
3436 | 3439 | } |
3437 | - | |
3440 | + $rootScope.isApplyBtnClicked = false; | |
3438 | 3441 | $rootScope.CloseSetting = function () { |
3439 | - | |
3442 | + | |
3440 | 3443 | $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); |
3441 | 3444 | $rootScope.setModestySettings($rootScope.globalSetting.modesty); |
3442 | - | |
3445 | + if ($rootScope.isApplyBtnClicked == false) { | |
3446 | + | |
3447 | + $rootScope.deSelectLanguageOptions(); | |
3448 | + } | |
3449 | + else { | |
3450 | + | |
3451 | + $rootScope.isApplyBtnClicked = false; | |
3452 | + } | |
3443 | 3453 | $('#modal-settings').css("display", "none"); |
3444 | 3454 | $("#modelsettingsbackground").css("display", "none"); |
3445 | 3455 | } |
3446 | 3456 | |
3447 | 3457 | $rootScope.UpdateAndCloseSetting = function (setting) { |
3448 | - // debugger; | |
3458 | + | |
3449 | 3459 | $rootScope.UpdateSetting(setting); |
3460 | +<<<<<<< HEAD | |
3450 | 3461 | if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") { |
3451 | 3462 | $rootScope.loadSearchData(); |
3452 | 3463 | } |
3464 | +======= | |
3465 | + $rootScope.loadSearchData(); | |
3466 | + $rootScope.isApplyBtnClicked = false; | |
3467 | +>>>>>>> settingPopupIssue_2 | |
3453 | 3468 | //$timeout(function () { |
3454 | 3469 | $('#modal-settings').css("display", "none"); |
3455 | 3470 | $("#modelsettingsbackground").css("display", "none"); |
3456 | 3471 | // $("#setting-spinner").css("display", "none"); |
3472 | +<<<<<<< HEAD | |
3457 | 3473 | if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") { |
3458 | 3474 | $("#setting-spinner").css("display", "block"); |
3459 | 3475 | } |
3476 | +======= | |
3477 | + $("#setting-spinner").css("display", "block"); | |
3478 | + | |
3479 | + $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length; | |
3480 | +>>>>>>> settingPopupIssue_2 | |
3460 | 3481 | |
3461 | 3482 | // }, 6000); |
3462 | 3483 | }; |
3463 | 3484 | |
3464 | 3485 | |
3465 | 3486 | $rootScope.CloseSettingPopup = function () { |
3487 | + if ($rootScope.isApplyBtnClicked == false) { | |
3488 | + $rootScope.deSelectLanguageOptions(); | |
3489 | + } | |
3490 | + else { | |
3491 | + $rootScope.isApplyBtnClicked = false; | |
3492 | + } | |
3466 | 3493 | $('#modal-settings').css("display", "none"); |
3467 | 3494 | $("#modelsettingsbackground").css("display", "none"); |
3468 | 3495 | } |
3469 | 3496 | |
3497 | + $rootScope.deSelectLanguageOptions = function () { | |
3498 | + | |
3499 | + var languageDifference = ($rootScope.lexiconLanguageArrayLength) - ($rootScope.lexiconLanguageArray.length); | |
3500 | + if (languageDifference > 0) { | |
3501 | + for (var i = 0; i <= $rootScope.lexiconRemovedLanguage.length - 1; i++) { | |
3502 | + $("#lexiconLangDropdown option").each(function () { | |
3503 | + if ($rootScope.lexiconRemovedLanguage[i].language == $(this).val()) { | |
3504 | + $(this).remove(); | |
3505 | + $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>'); | |
3506 | + $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language }); | |
3507 | + } | |
3508 | + }); | |
3509 | + } | |
3510 | + } | |
3511 | + else if (languageDifference < 0) { | |
3512 | + languageDifference = Math.abs(languageDifference); | |
3513 | + for (var i = 1; i <= languageDifference; i++) { | |
3514 | + var lexiconArrayLength = $rootScope.lexiconLanguageArray.length; | |
3515 | + | |
3516 | + $("#secondLax option").each(function () { | |
3517 | + if ($rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language == $(this).val()) { | |
3518 | + $(this).remove(); | |
3519 | + } | |
3520 | + | |
3521 | + }) | |
3522 | + $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>'); | |
3523 | + $rootScope.lexiconLanguageArray.pop(); | |
3524 | + } | |
3525 | + } | |
3526 | + | |
3470 | 3527 | |
3528 | + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) { | |
3529 | + // alert("same name"); | |
3530 | + } | |
3531 | + else { | |
3532 | + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID; | |
3533 | + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage; | |
3534 | + $("#lexiconLangDropdown option").each(function () { | |
3535 | + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) { | |
3536 | + $(this).remove(); | |
3537 | + } | |
3538 | + }) | |
3539 | + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>'); | |
3540 | + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage); | |
3541 | + $('#primarylaxican').attr("name", $rootScope.primaryLangID); | |
3542 | + } | |
3543 | + } | |
3544 | + | |
3545 | + | |
3471 | 3546 | $rootScope.UpdateSetting = function (setting) { |
3547 | + $rootScope.isApplyBtnClicked = true; | |
3472 | 3548 | var isReloadingViewRequired = false; |
3473 | 3549 | //1. |
3474 | 3550 | if (typeof (setting.ethnicity) !== "undefined" && setting.ethnicity !== null) { |
... | ... | @@ -3525,10 +3601,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3525 | 3601 | } |
3526 | 3602 | else { |
3527 | 3603 | |
3528 | - $('#modal-settings').css("display", "none"); | |
3529 | - $("#modelsettingsbackground").css("display", "none"); | |
3604 | + // $('#modal-settings').css("display", "none"); | |
3605 | + // $("#modelsettingsbackground").css("display", "none"); | |
3530 | 3606 | } |
3531 | - | |
3607 | + $rootScope.lexiconRemovedLanguage = []; | |
3608 | + $("#secondLax option").each(function () { | |
3609 | + $rootScope.lexiconRemovedLanguage.push({ "id": $(this).attr("val"), "language": $(this).val() }); | |
3610 | + }); | |
3532 | 3611 | }; |
3533 | 3612 | |
3534 | 3613 | ... | ... |