From 42fa28f850b5203e93472e99dc8125ae2a133d8c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 24 Oct 2015 00:36:18 +0200 Subject: [PATCH] feat(position): remove deprecated code BREAKING CHANGE: Remove deprecated non-prefixed service Closes #4721 --- src/position/position.js | 14 -------- src/position/test/position.spec.js | 58 ------------------------------ 2 files changed, 72 deletions(-) diff --git a/src/position/position.js b/src/position/position.js index 05020531e9..545fd28d35 100644 --- a/src/position/position.js +++ b/src/position/position.js @@ -148,17 +148,3 @@ angular.module('ui.bootstrap.position', []) } }; }]); - -/* Deprecated position below */ - -angular.module('ui.bootstrap.position') - -.value('$positionSuppressWarning', false) - -.service('$position', ['$log', '$positionSuppressWarning', '$uibPosition', function($log, $positionSuppressWarning, $uibPosition) { - if (!$positionSuppressWarning) { - $log.warn('$position is now deprecated. Use $uibPosition instead.'); - } - - angular.extend(this, $uibPosition); -}]); diff --git a/src/position/test/position.spec.js b/src/position/test/position.spec.js index 9b0f5a05ab..2919b1438d 100644 --- a/src/position/test/position.spec.js +++ b/src/position/test/position.spec.js @@ -104,61 +104,3 @@ describe('position elements', function () { }); }); }); - -/* Deprecation tests below */ - -describe('position deprecation', function() { - var TargetElMock = function(width, height) { - this.width = width; - this.height = height; - - this.prop = function(propName) { - return propName === 'offsetWidth' ? width : height; - }; - }; - beforeEach(module('ui.bootstrap.position')); - - it('should suppress warning', function() { - module(function($provide) { - $provide.value('$positionSuppressWarning', true); - }); - - inject(function($log, $position) { - spyOn($log, 'warn'); - //mock position info normally queried from the DOM - $position.position = function() { - return { - width: 20, - height: 20, - top: 100, - left: 100 - }; - }; - - $position.positionElements({}, new TargetElMock(10, 10), 'other'); - - expect($log.warn.calls.count()).toBe(0); - }); - }); - - it('should give warning by default', inject(function($log) { - spyOn($log, 'warn'); - - inject(function($position) { - //mock position info normally queried from the DOM - $position.position = function() { - return { - width: 20, - height: 20, - top: 100, - left: 100 - }; - }; - - $position.positionElements({}, new TargetElMock(10, 10), 'other'); - - expect($log.warn.calls.count()).toBe(1); - expect($log.warn.calls.argsFor(0)).toEqual(['$position is now deprecated. Use $uibPosition instead.']); - }); - })); -});