You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.1 KiB

4 years ago
  1. /* En esta sección se encuentra la función que controla los modals */
  2. function modalCreate($modal, type, title, body ){
  3. var modalInstance = $modal.open({
  4. templateUrl: 'partials/modal/main.html',
  5. controller: 'ModalController',
  6. size: 'md',
  7. resolve: {
  8. modal: function () {
  9. return {type: type, title: title, body: body};
  10. }
  11. }
  12. });
  13. return modalInstance;
  14. }
  15. function modalCreatelog($modal, logg ){
  16. var modalInstance = $modal.open({
  17. templateUrl: 'partials/user/main.html',
  18. controller: 'UserController',
  19. size: 'md',
  20. resolve: {
  21. modal: function () {
  22. return {logg: logg};
  23. }
  24. }
  25. });
  26. return modalInstance;
  27. }
  28. function size(){
  29. $('#main-container').css("min-height", ($(window).height()-$('footer').height())+"px");
  30. }
  31. /* Esta función actualmente no está en uso pero puede ser utilizada para enlazar a un objeto DOM */
  32. function goTo(position){
  33. $('html, body').animate({
  34. scrollTop: $('#'+position).offset().top
  35. }, 1500);
  36. setTimeout(function(){
  37. $('html, body').animate({
  38. scrollTop: $('#'+position).offset().top
  39. }, 500);
  40. }, 1600);
  41. }
  42. /* En esta sección se encuentran funciones para controlar el "scroll" y el "resize" en el navegador */
  43. $( document ).ready(function() {
  44. size();
  45. $( window ).resize(function() {
  46. size();
  47. });
  48. $(window).scroll(function(){
  49. size();
  50. });
  51. });
  52. app.directive("closedmenu", function () {
  53. return function(scope, element, attrs) {
  54. angular.element(element).bind("click", function() {
  55. if($('#btn-info').attr('aria-expanded') !='false'){
  56. $("#btn-info").trigger( "click" );
  57. }
  58. if($('#btn-app').attr('aria-expanded') !='false'){
  59. $("#btn-app").trigger( "click" );
  60. }
  61. });
  62. };
  63. });
  64. $(function() {
  65. $('#navbar .nav a').on('click', function(){
  66. if($('#btn-info').css('display') !='none'){
  67. $("#btn-info").trigger( "click" );
  68. }
  69. });
  70. // $('#navbar-bottom .nav a').on('click', function(){
  71. // if($('#btn-app').css('display') !='none'){
  72. // $("#btn-app").trigger( "click" );
  73. // }
  74. // });
  75. });