From 3865e15174329154eaed5eaba35e5d9e505a1ea0 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 25 Apr 2016 15:28:13 +0530 Subject: [PATCH] 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 | 67 ++++++++++++++++++++++++++++++++++++++++++++----------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 5 +++-- 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js | 11 ++++++++--- 3 files changed, 55 insertions(+), 28 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 9715be3..6fe2a9f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -85,7 +85,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module $scope.openView = function ($event) { - // debugger; + // debugger; $rootScope.currentBodyViewId = $event.currentTarget.id; $rootScope.ViewTitle = $event.currentTarget.textContent; @@ -141,17 +141,21 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module //da-body-view functions $scope.openBodyView = function () { - // debugger; - // $rootScope.jsPanelTitle = $rootScope.currentActiveViewTitle; - var openViews = new jinqJs() - .from($rootScope.openViews) - .where("BodyViewId==" + $rootScope.currentBodyViewId ) - .select(); - + + + var openViews; + // debugger; + if ($rootScope.openViews.length>0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId==" + $rootScope.currentBodyViewId) + .select(); + } var counter = 1; var tittle = $rootScope.ViewTitle; - if (openViews.length > 0) + + if (openViews!=null && openViews.length > 0) { angular.forEach(openViews, function (value, key) { @@ -191,13 +195,14 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module $rootScope.currentSlug = 'da-body-view'; - + $rootScope.openViews.push( { - "module": $rootScope.currentActiveModuleTitle, "BodyView": $rootScope.currentActiveViewTitle, "state": max,"BodyViewId": $rootScope.currentBodyViewId, + "module": $rootScope.currentActiveModuleTitle, "BodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, "slug": $rootScope.currentSlug } ); + // debugger; } angular.element(document).ready(function () { @@ -775,7 +780,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module //called on jspanel close $scope.openParent = function () { - debugger; + // debugger; var openViews = $rootScope.openViews; if (openViews.length > 0) { $rootScope.openViews.splice(openViews.length - 1); @@ -789,19 +794,35 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module //called on jsanel minimize $scope.setState = function (state,title) { - - $rootScope.openViews = new jinqJs() + //debugger; + + + $('#canvasDiv').css('overflow', 'scroll') + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) + $('#canvasDiv').scrollTop(50) + + var alreadyOpenThisView = new jinqJs() .from($rootScope.openViews) - .where("module == " + title) + .where("BodyView == " + title) .select(); - - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "BodyView":$rootScope.currentActiveViewTitle, "state": state, - "slug": $rootScope.currentSlug - } - ); - + var k=0; + if (alreadyOpenThisView != null) { + for (var i = 0; i < $rootScope.openViews.length; i++) { + k++; + if ($rootScope.openViews[i].BodyView == title) { + $rootScope.openViews.splice((k-1),1); + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "BodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); + } + } + } + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index cb67334..6a43b9b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -99,7 +99,7 @@ -
+
@@ -182,7 +182,7 @@ /*** Sidebar Toggle ***/ var barPos = 0; var bar = $('.leftToolBar'); - var main = $('.canavsParent'); + var main = $('.main2'); $('.toggleBar').click(function () { // alert('kkkkkkkkkkkkkk') /*barPos = parseInt($('.sidebar').css('left')); @@ -196,6 +196,7 @@ bar.removeClass('active'); main.removeClass('active'); }*/ + // $('#cp').width = $(window).outerWidth() - 10; bar.toggleClass('active'); main.toggleClass('active'); }); diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js index 0ef7b22..73c0217 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js @@ -1633,11 +1633,14 @@ console.log("jsPanel version: " + jsPanel.version); // jsPanel minimize $('.jsPanel-btn-min', jsP).on('click', function (e) { alert('minimized') + e.preventDefault(); jsPanel.minimize(jsP); - + debugger; + var headerTitle = $('.jsPanel-title'); + var title = headerTitle[0].innerHTML; var $scope = jsPanel.getScope('DAController'); - $scope.setState('min',jsPanel.header.title); + $scope.setState('min', title); $scope.$apply(); }); @@ -1646,8 +1649,10 @@ console.log("jsPanel version: " + jsPanel.version); e.preventDefault(); jsPanel.maximize(jsP); + var headerTitle = $('.jsPanel-title'); + var title = headerTitle[0].innerHTML; var $scope = jsPanel.getScope('DAController'); - $scope.setState('max', jsPanel.header.title); + $scope.setState('max', title); $scope.$apply(); }); -- libgit2 0.21.4