1 2app.controller("home-controller", function($scope, $rootScope, $compile, $route, $q, $http, $filter, $window, $timeout, $interval, $location, $mdMedia, $mdDialog, $mdSidenav, $mdBottomSheet, $mdToast, 3 ttDataAPI) { 4 5 $rootScope.windowScrollTop = $window.pageYOffset; 6 var windowEl = angular.element($window); 7 var handler = function() { 8 $rootScope.windowScrollTop = $window.pageYOffset; 9 $rootScope.$digest(); 10 11 $('[class*="scroll-"]').each(function() { 12 13 var $this = $(this); 14 15 var scrollClasses = ($this[0].className.match(/scroll-(\d+)/g) || []); 16 angular.forEach(scrollClasses, function(sc,idx){ 17 var scrollTop = sc.match(/scroll-(\d+)/)[1]; 18 // console.log(scrollTop); 19 if ($rootScope.windowScrollTop >= scrollTop) { 20 $this.addClass('scract-' + scrollTop); 21 } else { 22 $this.removeClass('scract-' + scrollTop); 23 } 24 }); 25 26 }); 27 28 } 29 windowEl.on('scroll', handler); 30 31 var openPopupHandler = function(event, sourceEvent, action) { 32 33 var popupDialogController = function($http, $q, $scope, $mdDialog, parentScope, sectionId) { 34 $scope.parentScope = parentScope; 35 36 $scope.cancel = function() { 37 $mdDialog.cancel(); 38 } 39 } 40 41 $mdDialog.show({ 42 controller: popupDialogController, 43 templateUrl: '/open-popup/' + action.section, 44 parent: angular.element('#root-panel'), 45 targetEvent: sourceEvent, 46 fullscreen: false, 47 multiple: true, 48 locals: { 49 parentScope: $scope, 50 sectionId: action.section, 51 }, 52 clickOutsideToClose: true, 53 escapeToClose: true, 54 onComplete: function(scope, element) { 55 56 initActionHandlers(element); 57 58 } 59 }); 60 61 } 62 63 windowEl.on('open-popup', openPopupHandler); 64 65 var closePopupHandler = function(event, action) { 66 67 $mdDialog.cancel(); 68 69 } 70 71 windowEl.on('close-popup', closePopupHandler); 72 73}); 74 75 76 77 78 79
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.