Commit 3865e15174329154eaed5eaba35e5d9e505a1ea0

Authored by Nikita Kulshreshtha
1 parent 3def4dc6

pushign the info of modules and views in an array after opening, closing, min, max of view.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -85,7 +85,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module @@ -85,7 +85,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
85 85
86 86
87 $scope.openView = function ($event) { 87 $scope.openView = function ($event) {
88 - // debugger; 88 + // debugger;
89 $rootScope.currentBodyViewId = $event.currentTarget.id; 89 $rootScope.currentBodyViewId = $event.currentTarget.id;
90 90
91 $rootScope.ViewTitle = $event.currentTarget.textContent; 91 $rootScope.ViewTitle = $event.currentTarget.textContent;
@@ -141,17 +141,21 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module @@ -141,17 +141,21 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
141 //da-body-view functions 141 //da-body-view functions
142 142
143 $scope.openBodyView = function () { 143 $scope.openBodyView = function () {
144 - // debugger;  
145 - // $rootScope.jsPanelTitle = $rootScope.currentActiveViewTitle;  
146 - var openViews = new jinqJs()  
147 - .from($rootScope.openViews)  
148 - .where("BodyViewId==" + $rootScope.currentBodyViewId )  
149 - .select();  
150 - 144 +
  145 +
  146 + var openViews;
  147 + // debugger;
  148 + if ($rootScope.openViews.length>0) {
  149 + openViews = new jinqJs()
  150 + .from($rootScope.openViews)
  151 + .where("BodyViewId==" + $rootScope.currentBodyViewId)
  152 + .select();
  153 + }
151 var counter = 1; 154 var counter = 1;
152 155
153 var tittle = $rootScope.ViewTitle; 156 var tittle = $rootScope.ViewTitle;
154 - if (openViews.length > 0) 157 +
  158 + if (openViews!=null && openViews.length > 0)
155 { 159 {
156 angular.forEach(openViews, function (value, key) { 160 angular.forEach(openViews, function (value, key) {
157 161
@@ -191,13 +195,14 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module @@ -191,13 +195,14 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
191 $rootScope.currentSlug = 'da-body-view'; 195 $rootScope.currentSlug = 'da-body-view';
192 196
193 197
194 - 198 +
195 $rootScope.openViews.push( 199 $rootScope.openViews.push(
196 { 200 {
197 - "module": $rootScope.currentActiveModuleTitle, "BodyView": $rootScope.currentActiveViewTitle, "state": max,"BodyViewId": $rootScope.currentBodyViewId, 201 + "module": $rootScope.currentActiveModuleTitle, "BodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
198 "slug": $rootScope.currentSlug 202 "slug": $rootScope.currentSlug
199 } 203 }
200 ); 204 );
  205 + // debugger;
201 } 206 }
202 207
203 angular.element(document).ready(function () { 208 angular.element(document).ready(function () {
@@ -775,7 +780,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module @@ -775,7 +780,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
775 780
776 //called on jspanel close 781 //called on jspanel close
777 $scope.openParent = function () { 782 $scope.openParent = function () {
778 - debugger; 783 + // debugger;
779 var openViews = $rootScope.openViews; 784 var openViews = $rootScope.openViews;
780 if (openViews.length > 0) { 785 if (openViews.length > 0) {
781 $rootScope.openViews.splice(openViews.length - 1); 786 $rootScope.openViews.splice(openViews.length - 1);
@@ -789,19 +794,35 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module @@ -789,19 +794,35 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
789 794
790 //called on jsanel minimize 795 //called on jsanel minimize
791 $scope.setState = function (state,title) { 796 $scope.setState = function (state,title) {
792 -  
793 - $rootScope.openViews = new jinqJs() 797 + //debugger;
  798 +
  799 +
  800 + $('#canvasDiv').css('overflow', 'scroll')
  801 + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
  802 + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
  803 + $('#canvasDiv').scrollTop(50)
  804 +
  805 + var alreadyOpenThisView = new jinqJs()
794 .from($rootScope.openViews) 806 .from($rootScope.openViews)
795 - .where("module == " + title) 807 + .where("BodyView == " + title)
796 .select(); 808 .select();
797 -  
798 - $rootScope.openViews.push(  
799 - {  
800 - "module": $rootScope.currentActiveModuleTitle, "BodyView":$rootScope.currentActiveViewTitle, "state": state,  
801 - "slug": $rootScope.currentSlug  
802 - }  
803 - );  
804 - 809 + var k=0;
  810 + if (alreadyOpenThisView != null) {
  811 + for (var i = 0; i < $rootScope.openViews.length; i++) {
  812 + k++;
  813 + if ($rootScope.openViews[i].BodyView == title) {
  814 + $rootScope.openViews.splice((k-1),1);
  815 +
  816 + $rootScope.openViews.push(
  817 + {
  818 + "module": $rootScope.currentActiveModuleTitle, "BodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId,
  819 + "slug": $rootScope.currentSlug
  820 + }
  821 + );
  822 + }
  823 + }
  824 + }
  825 +
805 } 826 }
806 827
807 828
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
@@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
99 </div> 99 </div>
100 </div> 100 </div>
101 </div> 101 </div>
102 - <div class=" canavsParent col-sm-12 " > 102 + <div class=" canavsParent col-sm-12 " id="cp">
103 <div class="container-fluid"> 103 <div class="container-fluid">
104 <div class="row"> 104 <div class="row">
105 <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center"></div> 105 <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center"></div>
@@ -182,7 +182,7 @@ @@ -182,7 +182,7 @@
182 /*** Sidebar Toggle ***/ 182 /*** Sidebar Toggle ***/
183 var barPos = 0; 183 var barPos = 0;
184 var bar = $('.leftToolBar'); 184 var bar = $('.leftToolBar');
185 - var main = $('.canavsParent'); 185 + var main = $('.main2');
186 $('.toggleBar').click(function () { 186 $('.toggleBar').click(function () {
187 // alert('kkkkkkkkkkkkkk') 187 // alert('kkkkkkkkkkkkkk')
188 /*barPos = parseInt($('.sidebar').css('left')); 188 /*barPos = parseInt($('.sidebar').css('left'));
@@ -196,6 +196,7 @@ @@ -196,6 +196,7 @@
196 bar.removeClass('active'); 196 bar.removeClass('active');
197 main.removeClass('active'); 197 main.removeClass('active');
198 }*/ 198 }*/
  199 + // $('#cp').width = $(window).outerWidth() - 10;
199 bar.toggleClass('active'); 200 bar.toggleClass('active');
200 main.toggleClass('active'); 201 main.toggleClass('active');
201 }); 202 });
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js
@@ -1633,11 +1633,14 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version); @@ -1633,11 +1633,14 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1633 // jsPanel minimize 1633 // jsPanel minimize
1634 $('.jsPanel-btn-min', jsP).on('click', function (e) { 1634 $('.jsPanel-btn-min', jsP).on('click', function (e) {
1635 alert('minimized') 1635 alert('minimized')
  1636 +
1636 e.preventDefault(); 1637 e.preventDefault();
1637 jsPanel.minimize(jsP); 1638 jsPanel.minimize(jsP);
1638 - 1639 + debugger;
  1640 + var headerTitle = $('.jsPanel-title');
  1641 + var title = headerTitle[0].innerHTML;
1639 var $scope = jsPanel.getScope('DAController'); 1642 var $scope = jsPanel.getScope('DAController');
1640 - $scope.setState('min',jsPanel.header.title); 1643 + $scope.setState('min', title);
1641 $scope.$apply(); 1644 $scope.$apply();
1642 }); 1645 });
1643 1646
@@ -1646,8 +1649,10 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version); @@ -1646,8 +1649,10 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1646 e.preventDefault(); 1649 e.preventDefault();
1647 jsPanel.maximize(jsP); 1650 jsPanel.maximize(jsP);
1648 1651
  1652 + var headerTitle = $('.jsPanel-title');
  1653 + var title = headerTitle[0].innerHTML;
1649 var $scope = jsPanel.getScope('DAController'); 1654 var $scope = jsPanel.getScope('DAController');
1650 - $scope.setState('max', jsPanel.header.title); 1655 + $scope.setState('max', title);
1651 $scope.$apply(); 1656 $scope.$apply();
1652 }); 1657 });
1653 1658