Commit 339151d0c810a352526a9ab0e5790e563ad36a82

Authored by Birendra
1 parent 31b4176b

resolve issue of dropdown slide select in cb

400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -12,6 +12,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
12 12 $rootScope.structureObjForSaveCB = [];
13 13 $rootScope.contentNotesForSaveCB = [];
14 14 $rootScope.dynamicUpdatedJsonForSaveCB = "";
  15 + $scope.isChangeFromDropDown=false;
15 16 //$rootScope.updateSaveDraftCB = [];
16 17 $scope.IsVisible = function () {
17 18 $scope.scroll();
... ... @@ -541,7 +542,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
541 542 }
542 543 }
543 544  
544   - $rootScope.cbSelectOnChange = function (obj) {
  545 + $rootScope.cbSelectOnChange = function (obj,prevValue) {
  546 + $scope.isChangeFromDropDown=true;
  547 + $scope.lastSlideValue=prevValue;
545 548 $('#jstree').jstree(true).deselect_all();
546 549 $('#jstree').jstree('select_node', obj.value);
547 550 }
... ... @@ -563,11 +566,25 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
563 566 if ($rootScope.contentNotesForSaveCB.length == 0) {
564 567 $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents
565 568 }
566   - var currentCb_id = document.getElementById('cbSelect').value;
567   - $rootScope.updatedContentFromEditor(currentCb_id);//Calling for Update Note for Save CB
  569 +
  570 + if($scope.isChangeFromDropDown==true)
  571 + {
  572 + // modified by birendra
  573 + // in case of select dropdown current and prev id come same.
  574 + var lastslideid = $scope.lastSlideValue;
  575 + $scope.isChangeFromDropDown=false;
  576 + $scope.lastSlideValue="";
  577 +
  578 + }
  579 + else
  580 + {
  581 + var lastslideid = document.getElementById('cbSelect').value;
  582 + }
  583 +
  584 + $rootScope.updatedContentFromEditor(lastslideid);//Calling for Update Note for Save CB
568 585  
569 586 if (isActive) {
570   - $scope.updateWindowsContentForSaveCB(currentCb_id,true);// Calling for Update Window content for Save Cb
  587 + $scope.updateWindowsContentForSaveCB(lastslideid,true);// Calling for Update Window content for Save Cb
571 588 }
572 589 isActive = true;
573 590 traverseTreeSelectedSingleObj($rootScope.stru, nodeid);
... ... @@ -628,6 +645,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
628 645  
629 646 $rootScope.cbNext = function () {
630 647  
  648 + $scope.isChangeFromDropDown=false;
631 649 var cbCurrentId = document.getElementById('cbSelect').value;
632 650 var counter = 0;
633 651  
... ... @@ -655,6 +673,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
655 673 }
656 674  
657 675 $rootScope.cbBack = function () {
  676 + $scope.isChangeFromDropDown=false;
658 677 var cbCurrentId = document.getElementById('cbSelect').value;
659 678 var counter = 0;
660 679 $("#jstree").jstree("open_all");
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html
... ... @@ -21,7 +21,7 @@
21 21 <img src="../../../content/images/CB/icon-next.png" alt="">
22 22 </button>
23 23 <div class="form-group">
24   - <select id='cbSelect' onchange="cbSelectOnChange(this)"></select>
  24 + <select id='cbSelect'></select>
25 25  
26 26 <!--<select ng-model="selectedCountry" ng-options="item.countryId as item.name for item in chooseCountries">
27 27 <option value="">Select Account</option>
... ... @@ -94,6 +94,14 @@
94 94  
95 95 });
96 96  
  97 + var previous;
  98 +
  99 + $("#cbSelect").on('focus', function () {
  100 + previous = document.getElementById('cbSelect').value;
  101 + }).change(function() {
  102 + cbSelectOnChange(this,previous);
  103 + previous = this.value;
  104 + });
97 105  
98 106 //Modified code by Sandeep for fixed bug TicketNo: 49226(6)
99 107 function editorHideShow() {
... ... @@ -125,9 +133,9 @@
125 133  
126 134 angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().showDeleteSlideModel();
127 135 }
128   - function cbSelectOnChange(obj) {
  136 + function cbSelectOnChange(obj,prevValue) {
129 137  
130   - angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbSelectOnChange(obj);
  138 + angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbSelectOnChange(obj,prevValue);
131 139 }
132 140 function myeditorclick() {
133 141  
... ...