diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index e925af2..7b125e8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -426,7 +426,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //da-body-views functions $scope.openBodyView = function () { - + //0. we will initially append container to load body //check if localstorage has any settings @@ -441,116 +441,127 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } //0.1 + var currentBodyViewId = localStorage.getItem("currentBodyViewId"); - - $scope.loadSearchDataForBodyView(); + if (currentBodyViewId == null || currentBodyViewId == undefined) { + // document.location = '/'; + document.location = '/'; + $rootScope.isVisibleLogin = true; + + } + else { + $rootScope.isVisibleLogin = false; + $scope.loadSearchDataForBodyView(); - console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); + console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); - var openViews; - if ($rootScope.openViews != null || $rootScope.openViews != undefined) { - if ($rootScope.openViews.length > 0) { - openViews = new jinqJs() - .from($rootScope.openViews) - .where("BodyViewId == " + currentBodyViewId) - .select(); + var openViews; + if ($rootScope.openViews != null || $rootScope.openViews != undefined) { + if ($rootScope.openViews.length > 0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId == " + currentBodyViewId) + .select(); + } } - } - // 0.2 getting corresponding body view title - //var counter = 1; - var tittle = localStorage.getItem("currentViewTitleFromJson"); - localStorage.setItem("currentViewTitle", tittle); + // 0.2 getting corresponding body view title + //var counter = 1; + var tittle = localStorage.getItem("currentViewTitleFromJson"); + localStorage.setItem("currentViewTitle", tittle); - //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD - //if (openViews != null && openViews != undefined) { - // angular.forEach(openViews, function (value, key) { + //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD + //if (openViews != null && openViews != undefined) { + // angular.forEach(openViews, function (value, key) { - // if (value.bodyView == tittle) { - // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - // $rootScope.currentActiveViewTitle = tittle; - // localStorage.setItem("currentViewTitle", tittle); - // } + // if (value.bodyView == tittle) { + // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + // $rootScope.currentActiveViewTitle = tittle; + // localStorage.setItem("currentViewTitle", tittle); + // } - // }); - //} - //else { - // localStorage.setItem("currentViewTitle", tittle); - //} - - //0.3 + // }); + //} + //else { + // localStorage.setItem("currentViewTitle", tittle); + //} - $.jsPanel({ - id: 'daImagePanel', - selector: '.daBodyView', - theme: 'success', - currentController: 'DAController', - parentSlug: 'da-view-list', - ajax: { - url: 'app/views/da/da-view.html' - }, - title: localStorage.getItem("currentViewTitle"), + //0.3 - position: { - top: 70, - left: 1, - }, + $.jsPanel({ + id: 'daImagePanel', + selector: '.daBodyView', + theme: 'success', + currentController: 'DAController', + parentSlug: 'da-view-list', + ajax: { + url: 'app/views/da/da-view.html' + }, + title: localStorage.getItem("currentViewTitle"), - size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, + position: { + top: 70, + left: 1, + }, - }); + size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, - console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) - //0.1 - $rootScope.currentSlug = 'da-body-view'; + }); - //0.2 - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); + console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) + //0.1 + $rootScope.currentSlug = 'da-body-view'; - //0.3 - var daBodyviewElement = angular.element(document.getElementById("daBodyview")); + //0.2 + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); - $timeout(function () { - $compile(daBodyviewElement.contents())($scope); + //0.3 + var daBodyviewElement = angular.element(document.getElementById("daBodyview")); - console.log('html is compiled' + document.getElementById('daView')) - if (document.getElementById('daView') != null) { + $timeout(function () { + $compile(daBodyviewElement.contents())($scope); - //0.4 added some stylesheets - $('#daBodyview').css("height", $(window).outerHeight()); + console.log('html is compiled' + document.getElementById('daView')) + if (document.getElementById('daView') != null) { - $('#daBodyview').css("width", $(window).outerWidth()); + //0.4 added some stylesheets + $('#daBodyview').css("height", $(window).outerHeight()); - //1. load navigator man first - console.log('before LoadBodyViewNavigatorImage call') - $scope.LoadBodyViewNavigatorImage(); + $('#daBodyview').css("width", $(window).outerWidth()); - //$scope.loadSearchDataForBodyView(); + //1. load navigator man first + console.log('before LoadBodyViewNavigatorImage call') + $scope.LoadBodyViewNavigatorImage(); - $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); + //$scope.loadSearchDataForBodyView(); - $scope.layerNumber = 0; + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); - //2. + $scope.layerNumber = 0; - console.log('currentBodyViewId just before sending: ' + currentBodyViewId); - $scope.loadBodyViewData(currentBodyViewId); + //2. + - //2. load bodyRegion data - $rootScope.isLoading = true; - $rootScope.voId = localStorage.getItem("currentBodyViewId"); + console.log('currentBodyViewId just before sending: ' + currentBodyViewId); + $scope.loadBodyViewData(currentBodyViewId); + //2. load bodyRegion data + $rootScope.isLoading = true; + $rootScope.voId = localStorage.getItem("currentBodyViewId"); + } $('#daBodyview').css("height", $(window).outerHeight()); $('#daBodyview').css("width", $(window).outerWidth()); - } - }, 250); + + }, 250); + } + } angular.element(document).ready(function (e) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html index d48a973..7e4b22c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html @@ -26,25 +26,8 @@