diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index ae2aa73..d9d13b1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -303,6 +303,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo id: 'daImagePanel', selector: '.daBodyView', theme: 'success', + currentController: 'DAController', + parentSlug:'da-view-list', ajax: { url: 'app/views/da/da-view.html' }, @@ -1311,50 +1313,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //alert('Disabled wait cursor is done.See val :' + $rootScope.isLoading); } - //called on jspanel close - $scope.openParent = function () { - // debugger; - var openViews = $rootScope.openViews; - if (openViews.length > 0) { - $rootScope.openViews.splice(openViews.length - 1); - } - if (openViews.length > 0) { - var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; - } - $('#daImagePanel').remove(); - $location.url('/da-view-list'); - } - - //called on jsanel minimize - $scope.setState = function (state, title) { - //debugger; - - - var alreadyOpenThisView = new jinqJs() - .from($rootScope.openViews) - .where("body-views == " + title) - .select(); - var k = 0; - if (alreadyOpenThisView != null) { - for (var i = 0; i < $rootScope.openViews.length; i++) { - k++; - if ($rootScope.openViews[i].body - views == title) { - $rootScope.openViews.splice((k - 1), 1); - - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "body-views": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - } - ); - } - } - } - if (state == 'max') { - $('#daBodyview').css('width', '100%') - } - } - + $scope.changeLayer = function () { console.log('changeLayer'); // alert('slide') diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 466b402..58cbe69 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -29,6 +29,50 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.lastX; $rootScope.lastY; + //jspanel functionality.. + $rootScope.openParent = function (slug) { + // debugger; + var openViews = $rootScope.openViews; + if (openViews.length > 0) { + $rootScope.openViews.splice(openViews.length - 1); + } + if (openViews.length > 0) { + var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; + } + $('#daImagePanel').remove(); + $location.url('/' + slug); + } + + //called on jsanel minimize + $rootScope.setState = function (state, title) { + debugger; + + + var alreadyOpenThisView = new jinqJs() + .from($rootScope.openViews) + .where("body-views == " + title) + .select(); + var k = 0; + if (alreadyOpenThisView != null) { + for (var i = 0; i < $rootScope.openViews.length; i++) { + k++; + if ($rootScope.openViews[i].body - views == title) { + $rootScope.openViews.splice((k - 1), 1); + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "body-views": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); + } + } + } + if (state == 'max') { + $('#daBodyview').css('width', '100%') + } + } + $rootScope.ClearIframe = function () { @@ -38,6 +82,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.hideScrollbar(); } + //ends + $rootScope.hideScrollbar = function () { $(".sidebar").mCustomScrollbar({ autoHideScrollbar: true, 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 aa6e3ec..757229b 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 @@ -75,7 +75,7 @@ var jsPanel = { '
' + '

' + '
' + - '
' + + '
' + '
' + '
' + '
' + @@ -766,7 +766,7 @@ var jsPanel = { // loads content using jQuery.load() load: function (panel) { - // alert('pppp') + // alert('pppp') panel.content.load(panel.option.load.url, panel.option.load.data || undefined, function (responseText, textStatus, jqXHR) { if ($.isFunction(panel.option.load.complete)) { panel.option.load.complete.call(panel.content, responseText, textStatus, jqXHR, panel); @@ -821,17 +821,19 @@ var jsPanel = { //height: $(window).outerHeight() - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) }); //nikita - if (panel.outerHeight() >= 435 && panel.outerWidth() >= 650) { - // alert('if') - $('#canvasDiv').css('height', panel.outerHeight() - 75) - $('#canvasDiv').css('width', panel.outerWidth() - 100) - $('#canvasDiv').css('overflow', 'scroll') - } - else { - // alert('else') - $('#canvasDiv').css('height', panel.outerHeight() - 110) - $('#canvasDiv').css('width', panel.outerWidth() - 90) - $('#canvasDiv').css('overflow', 'scroll') + if ($('#canvasDiv') != null) { + if (panel.outerHeight() >= 435 && panel.outerWidth() >= 650) { + // alert('if') + $('#canvasDiv').css('height', panel.outerHeight() - 75) + $('#canvasDiv').css('width', panel.outerWidth() - 100) + $('#canvasDiv').css('overflow', 'scroll') + } + else { + // alert('else') + $('#canvasDiv').css('height', panel.outerHeight() - 110) + $('#canvasDiv').css('width', panel.outerWidth() - 90) + $('#canvasDiv').css('overflow', 'scroll') + } } //nikita if (!panel.option.controls.maxtoScreen || (panel.option.controls.maxtoScreen && panel.option.selector === 'body')) { @@ -858,23 +860,25 @@ var jsPanel = { } //nikita + if ($('#canvasDiv') != null){ if (panel.outerHeight() >= 435 && panel.outerWidth() >= 650) { //alert('if') - // debugger; + // debugger; $('#canvasDiv').css('height', panel.outerHeight() - 85) $('#canvasDiv').css('width', panel.outerWidth() - 90) $('#canvasDiv').css('overflow', 'scroll') } else { - // alert('else') + // alert('else') $('#canvasDiv').css('height', panel.outerHeight() - 105) $('#canvasDiv').css('width', panel.outerWidth() - 80) $('#canvasDiv').css('overflow', 'scroll') } + } //nikita - // debugger; - // $(".fa-minus").removeClass('display'); + // debugger; + // $(".fa-minus").removeClass('display'); $('#minSpan').css({ 'display': '' }); }, @@ -1110,8 +1114,11 @@ var jsPanel = { this.resizeContent(panel); this.resizeTitle(panel); } - $('#canvasDiv').css('height', $(window).outerHeight() - 120) - $('#leftToolBar').css('height', $(window).outerHeight() - 120) + if ($('#canvasDiv') != null) { + $('#canvasDiv').css('height', $(window).outerHeight() - 120) + $('#leftToolBar').css('height', $(window).outerHeight() - 120) + + } }, // reset dimensions of content section after resize and so on @@ -1486,6 +1493,13 @@ var jsPanel = { var sel = 'div[ng-controller="' + ctrlName + '"]'; return angular.element(sel).scope(); }, + + getRootScope: function (controllerName) { + debugger; + var $body = angular.element(document.body); // 1 + return $body.scope().$root; + +} }; console.log("jsPanel version: " + jsPanel.version); @@ -1657,8 +1671,10 @@ console.log("jsPanel version: " + jsPanel.version); // jsPanel.close(jsP, jsP.parentElmtTagname); // } //} - var $scope = jsPanel.getScope('DAController'); - $scope.openParent(); + + + var $scope = jsPanel.getRootScope('HomeController'); + $scope.openParent(jsP.option.parentSlug); $scope.$apply(); }); @@ -1674,14 +1690,20 @@ console.log("jsPanel version: " + jsPanel.version); // debugger; var headerTitle = $('.jsPanel-title'); var title = headerTitle[0].innerHTML; - var $scope = jsPanel.getScope('DAController'); - $scope.setState('min', title); - - var canvasDiv = document.getElementById('canvasDiv'); - $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; - $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; - - $scope.$apply(); + + var $rootscope = jsPanel.getRootScope('HomeController'); + //$rootscope.openParent(jsP.option.parentSlug); + $rootscope.setState('min', title); + $rootscope.$apply(); + + var currentController = jsP.option.currentController; + if (currentController == 'DAController') { + var $scope = jsPanel.getScope(currentController); + var canvasDiv = document.getElementById('canvasDiv'); + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; + $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; + $scope.$apply(); + } }); // jsPanel maximize @@ -1689,7 +1711,7 @@ console.log("jsPanel version: " + jsPanel.version); // debugger; e.preventDefault(); jsPanel.maximize(jsP); - + $('.jsPanel-btn-min').css('display', 'initial'); $('.fa fa-minus').css('display', 'initial'); @@ -1697,24 +1719,27 @@ console.log("jsPanel version: " + jsPanel.version); var headerTitle = $('.jsPanel-title'); var title = headerTitle[0].innerHTML; - var $scope = jsPanel.getScope('DAController'); - $scope.setState('max', title); - $scope.$apply(); + var $rootscope = jsPanel.getRootScope('HomeController'); + $rootscope.setState('max', title); + $rootscope.$apply(); }); // jsPanel normalize $('.jsPanel-btn-norm', jsP).on('click', function (e) { - // debugger; + // debugger; e.preventDefault(); jsPanel.normalize(jsP); - var $scope = jsPanel.getScope('DAController'); + var currentController = jsP.option.currentController; + if (currentController == 'DAController') { + var $scope = jsPanel.getScope(currentController); - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) - $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) - $scope.$apply(); + $scope.$apply(); + } }); // jsPanel smallify @@ -2122,16 +2147,18 @@ console.log("jsPanel version: " + jsPanel.version); height: jsP.outerHeight() }; //nikita - if (jsP.outerHeight() >= 435 && jsP.outerWidth() >= 650) { - // alert('resizestop') - $('#canvasDiv').css('height', jsP.outerHeight() - 85) - $('#canvasDiv').css('width', jsP.outerWidth() - 95) - $('#canvasDiv').css('overflow', 'scroll') - } - else { - $('#canvasDiv').css('height', jsP.outerHeight() - 110) - $('#canvasDiv').css('width', jsP.outerWidth() - 85) - $('#canvasDiv').css('overflow', 'scroll') + if ($('#canvasDiv') != null) { + if (jsP.outerHeight() >= 435 && jsP.outerWidth() >= 650) { + // alert('resizestop') + $('#canvasDiv').css('height', jsP.outerHeight() - 85) + $('#canvasDiv').css('width', jsP.outerWidth() - 95) + $('#canvasDiv').css('overflow', 'scroll') + } + else { + $('#canvasDiv').css('height', jsP.outerHeight() - 110) + $('#canvasDiv').css('width', jsP.outerWidth() - 85) + $('#canvasDiv').css('overflow', 'scroll') + } } //nikita // $('#leftToolBar').css('height', jsP.outerWidth()) @@ -2320,8 +2347,9 @@ console.log("jsPanel version: " + jsPanel.version); "theme": 'default', "title": 'jsPanel', "toolbarFooter": false, - "toolbarHeader": false - + "toolbarHeader": false, + "currentController": '', + "parentSlug":'' };