()
| 4824 | // this is prefixed with Core since it conflicts with |
| 4825 | // the animateQueueProvider defined in ngAnimate/animateQueue.js |
| 4826 | var $$CoreAnimateQueueProvider = function() { |
| 4827 | var postDigestQueue = new HashMap(); |
| 4828 | var postDigestElements = []; |
| 4829 | |
| 4830 | this.$get = ['$$AnimateRunner', '$rootScope', |
| 4831 | function($$AnimateRunner, $rootScope) { |
| 4832 | return { |
| 4833 | enabled: noop, |
| 4834 | on: noop, |
| 4835 | off: noop, |
| 4836 | pin: noop, |
| 4837 | |
| 4838 | push: function(element, event, options, domOperation) { |
| 4839 | domOperation && domOperation(); |
| 4840 | |
| 4841 | options = options || {}; |
| 4842 | options.from && element.css(options.from); |
| 4843 | options.to && element.css(options.to); |
| 4844 | |
| 4845 | if (options.addClass || options.removeClass) { |
| 4846 | addRemoveClassesPostDigest(element, options.addClass, options.removeClass); |
| 4847 | } |
| 4848 | |
| 4849 | return new $$AnimateRunner(); // jshint ignore:line |
| 4850 | } |
| 4851 | }; |
| 4852 | |
| 4853 | function addRemoveClassesPostDigest(element, add, remove) { |
| 4854 | var data = postDigestQueue.get(element); |
| 4855 | var classVal; |
| 4856 | |
| 4857 | if (!data) { |
| 4858 | postDigestQueue.put(element, data = {}); |
| 4859 | postDigestElements.push(element); |
| 4860 | } |
| 4861 | |
| 4862 | if (add) { |
| 4863 | forEach(add.split(' '), function(className) { |
| 4864 | if (className) { |
| 4865 | data[className] = true; |
| 4866 | } |
| 4867 | }); |
| 4868 | } |
| 4869 | |
| 4870 | if (remove) { |
| 4871 | forEach(remove.split(' '), function(className) { |
| 4872 | if (className) { |
| 4873 | data[className] = false; |
| 4874 | } |
| 4875 | }); |
| 4876 | } |
| 4877 | |
| 4878 | if (postDigestElements.length > 1) return; |
| 4879 | |
| 4880 | $rootScope.$$postDigest(function() { |
| 4881 | forEach(postDigestElements, function(element) { |
| 4882 | var data = postDigestQueue.get(element); |
| 4883 | if (data) { |
nothing calls this directly
no test coverage detected