From 149698151b32602d3fd5091a9043742c518b3b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Maur=C3=ADcio?= Date: Fri, 9 May 2014 14:14:39 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@1914 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../static/html/app/Form2/Form2Controller.js | 2 +- .../static/html/app/Form3/Form3Controller.js | 2 +- .../static/html/app/Form5/Form5Controller.js | 2 +- .../static/html/app/Main/MainController.js | 30 +++++++++++++++++-- .../static/html/app/services/Plugins.js | 16 ++++++++++ 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js index 2f3ce68b..14b50d26 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js @@ -77,7 +77,7 @@ if(response.success && complete) { - globals.plugins.hideSideMenu(); + globals.plugins.hideFloatingSideMenu(); $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js index 3c134d58..920a47af 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3Controller.js @@ -77,7 +77,7 @@ if(response.success && complete) { - globals.plugins.hideSideMenu(); + globals.plugins.hideFloatingSideMenu(); $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form5/Form5Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form5/Form5Controller.js index c2de55a0..2e799c00 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form5/Form5Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form5/Form5Controller.js @@ -77,7 +77,7 @@ // if(response.success && complete) // { - // globals.plugins.hideSideMenu(); + // globals.plugins.hideFloatingSideMenu(); // $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js index c4a39396..d660d3a9 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js @@ -301,9 +301,13 @@ //render module if not rendered yet... if(module == null) { + $scope.$emit('onBeforeMainPanelChange', {mainPanel: $scope.divMainPanel, module: module}); + $scope.renderModule('body #main-panel', subModule.Controller, (configs || null), true, function(className, scope){ $("body, html").animate({scrollTop : 0}, 0); + + $scope.$emit('onAfterMainPanelChange', {mainPanel: $scope.divMainPanel, module: module}); //execute callback if available if(callback != undefined) @@ -346,10 +350,32 @@ if(!isInMainPanel) { + $scope.$emit('onBeforeMainPanelChange', {mainPanel: $scope.divMainPanel, module: module}); + //add current module to main-panel if not there yet - module.domEl.appendTo($scope.divMainPanel); + module.domEl.appendTo($scope.divMainPanel); + + $scope.$emit('onAfterMainPanelChange', {mainPanel: $scope.divMainPanel, module: module}); } - } + }; + + $scope.$on('onBeforeMainPanelChange', function(event, args){ + + $rootScope.$broadcast('loadingStatusActive'); + + //$(args.mainPanel).hide(); + }); + + $scope.$on('onAfterMainPanelChange', function(event, args){ + + $timeout(function () { + + //$(args.mainPanel).fadeIn(); + + $rootScope.$broadcast('loadingStatusInactive'); + + }, 0); + }); $scope.getModule = function(className){ diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js index 9f247fc5..49059b5b 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Plugins.js @@ -257,6 +257,22 @@ if(options.scrollspyItems) { + var links = options.scrollspyItems.find('li'); + links.each(function(index) { + + if(index == 0) + { + $(this).addClass("active"); + } + else + { + if($(this).hasClass("active")) + { + $(this).removeClass("active"); + } + } + }); + wrapper.append(options.scrollspyItems); }