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 85  
86 86  
87 87 $scope.openView = function ($event) {
88   - // debugger;
  88 + // debugger;
89 89 $rootScope.currentBodyViewId = $event.currentTarget.id;
90 90  
91 91 $rootScope.ViewTitle = $event.currentTarget.textContent;
... ... @@ -141,17 +141,21 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
141 141 //da-body-view functions
142 142  
143 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 154 var counter = 1;
152 155  
153 156 var tittle = $rootScope.ViewTitle;
154   - if (openViews.length > 0)
  157 +
  158 + if (openViews!=null && openViews.length > 0)
155 159 {
156 160 angular.forEach(openViews, function (value, key) {
157 161  
... ... @@ -191,13 +195,14 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
191 195 $rootScope.currentSlug = 'da-body-view';
192 196  
193 197  
194   -
  198 +
195 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 202 "slug": $rootScope.currentSlug
199 203 }
200 204 );
  205 + // debugger;
201 206 }
202 207  
203 208 angular.element(document).ready(function () {
... ... @@ -775,7 +780,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
775 780  
776 781 //called on jspanel close
777 782 $scope.openParent = function () {
778   - debugger;
  783 + // debugger;
779 784 var openViews = $rootScope.openViews;
780 785 if (openViews.length > 0) {
781 786 $rootScope.openViews.splice(openViews.length - 1);
... ... @@ -789,19 +794,35 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
789 794  
790 795 //called on jsanel minimize
791 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 806 .from($rootScope.openViews)
795   - .where("module == " + title)
  807 + .where("BodyView == " + title)
796 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 99 </div>
100 100 </div>
101 101 </div>
102   - <div class=" canavsParent col-sm-12 " >
  102 + <div class=" canavsParent col-sm-12 " id="cp">
103 103 <div class="container-fluid">
104 104 <div class="row">
105 105 <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center"></div>
... ... @@ -182,7 +182,7 @@
182 182 /*** Sidebar Toggle ***/
183 183 var barPos = 0;
184 184 var bar = $('.leftToolBar');
185   - var main = $('.canavsParent');
  185 + var main = $('.main2');
186 186 $('.toggleBar').click(function () {
187 187 // alert('kkkkkkkkkkkkkk')
188 188 /*barPos = parseInt($('.sidebar').css('left'));
... ... @@ -196,6 +196,7 @@
196 196 bar.removeClass('active');
197 197 main.removeClass('active');
198 198 }*/
  199 + // $('#cp').width = $(window).outerWidth() - 10;
199 200 bar.toggleClass('active');
200 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 1633 // jsPanel minimize
1634 1634 $('.jsPanel-btn-min', jsP).on('click', function (e) {
1635 1635 alert('minimized')
  1636 +
1636 1637 e.preventDefault();
1637 1638 jsPanel.minimize(jsP);
1638   -
  1639 + debugger;
  1640 + var headerTitle = $('.jsPanel-title');
  1641 + var title = headerTitle[0].innerHTML;
1639 1642 var $scope = jsPanel.getScope('DAController');
1640   - $scope.setState('min',jsPanel.header.title);
  1643 + $scope.setState('min', title);
1641 1644 $scope.$apply();
1642 1645 });
1643 1646  
... ... @@ -1646,8 +1649,10 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1646 1649 e.preventDefault();
1647 1650 jsPanel.maximize(jsP);
1648 1651  
  1652 + var headerTitle = $('.jsPanel-title');
  1653 + var title = headerTitle[0].innerHTML;
1649 1654 var $scope = jsPanel.getScope('DAController');
1650   - $scope.setState('max', jsPanel.header.title);
  1655 + $scope.setState('max', title);
1651 1656 $scope.$apply();
1652 1657 });
1653 1658  
... ...