1angular.module('nefiksApp') 2 .directive('popupCommonDir', function($rootScope) { 3 return { 4 restrict: 'A', 5 scope: { 6 title:'=', 7 msg:'=', 8 yesLabel:'=', 9 noLabel:'=', 10 opened:'=', 11 onYesClick:'&', 12 onNoClick:'&', 13 tagData:'=' 14 }, 15 replace: true, 16 templateUrl: 'angular/views/common/popupCommon.html', 17 controller: function($scope, $element, $attrs) { 18 $scope.Utf8 = $rootScope.Utf8; 19 20 $scope.onConfirm = function() { 21 if(!!$attrs.onYesClick) { 22 $scope.onYesClick({tag: $scope.tagData}); 23 } else { 24 $scope.opened = false; 25 } 26 }; 27 28 $scope.onDeny = function() { 29 if(!!$attrs.onNoClick) { 30 $scope.onNoClick({tag: $scope.tagData}); 31 } else { 32 $scope.opened = false; 33 } 34 }; 35 }, 36 link: function($scope, $element, attrs) { 37 $scope.$watch('opened', function(newValue) { 38 $rootScope.modalOpen = !!newValue; 39 if(!!newValue) { 40 $element.focus(); 41 } 42 }); 43 44 /* 45 $element.addClass('modal fade'); //Fixed classes 46 $scope.$watch('opened', function(newValue) { 47 $rootScope.modalOpen = !!newValue; 48 if(!!newValue) { 49 var inp = $element.find('input:first'); 50 if(inp.length > 0) { 51 setTimeout(function() {inp.focus();}, 100); 52 } else { 53 setTimeout(function() {$element.focus();}, 100); 54 } 55 $element.addClass('bs-example-modal-sm-in in opened'); 56 $element.removeClass('bs-example-modal-sm'); 57 } else { 58 $element.addClass('bs-example-modal-sm'); 59 $element.removeClass('bs-example-modal-sm-in in opened'); 60 } 61 }); 62 */ 63 $element.bind('keydown', function(event) { 64 if(event.which == 27) { 65 $scope.$apply($scope.onDeny()); 66 } else if(event.which == 13) { 67 $scope.$apply($scope.onConfirm()); 68 } 69 }); 70 } 71 }; 72 });
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.