1app.controller('announcementCtrl', ['$scope','$rootScope','$modal','$timeout', function($scope,$rootScope,$modal,$timeout) { 2 3 /** 4 * Get Announcement for the business. 5 */ 6 $scope.showAnnouncement = function() { 7 var contextPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2)); 8 var url=contextPath; 9 var appName=$("#applicationName").val(); 10 if (appName.indexOf("bossPortal") == -1) { 11 window.location = $rootScope.hostURL + "/#!home/dashboard/showAnnouncement"; 12 return; 13 } 14 url+=appName.indexOf("bossPortal")!=-1?"/":"/pages/"; 15 var modalOptions = { 16 templateUrl: url+'app/templates/announcement/view_announcement_modal.html', 17 controller: 'viewAnnouncementInstanceCtrl', 18 size: 'lg' 19 }; 20 var modalInstance = $modal.open(modalOptions); 21 $timeout(function(){ 22 let isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent); 23 var sideBar=$("#page-sidebar").css("visibility") === "visible"; 24 var width=$(window).width(); 25 var leftWidth=0; 26 var modalDialog = $(".modal-dialog"); 27 if(sideBar){ 28 leftWidth=$("#page-sidebar").width(); 29 var leftMargin = (leftWidth*100) / width; 30 modalDialog.css("margin-left", (leftMargin + (isIEOrEdge ? 9 : 8) ) +"%"); 31 /* Applying the top margin on modal dialog to align it vertically center */ 32 modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2)); 33 }else{ 34 modalDialog.center(true); 35 } 36 },100); 37 }; 38 39 jQuery.fn.center = function(parent) { 40 if (parent) { 41 parent = this.parent(); 42 } else { 43 parent = window; 44 } 45 this.css({ 46 "position": "absolute", 47 "top": ((($(parent).height() - this.outerHeight()) / 2) + $(parent).scrollTop() + "px"), 48 "left": ((($(parent).width() - this.outerWidth()) / 2) + $(parent).scrollLeft() + "px") 49 }); 50 return this; 51 } 52 53}]);
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.