From d9ff5fd432314d2b5f5e6766240c918f10d3b83d Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 12 Jun 2012 00:11:04 -0700 Subject: fix(docs): migrate from $defer to $timeout --- docs/src/templates/js/docs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/src/templates') diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index 2eaa7c29..de40db64 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -5,16 +5,18 @@ var docsApp = { }; -docsApp.directive.focused = function($defer) { +docsApp.directive.focused = function($timeout) { return function(scope, element, attrs) { element[0].focus(); element.bind('focus', function() { scope.$apply(attrs.focused + '=true'); }); element.bind('blur', function() { - // have to use defer, so that we close the drop-down after the user clicks, + // have to use $timeout, so that we close the drop-down after the user clicks, // otherwise when the user clicks we process the closing before we process the click. - $defer(attrs.focused + '=false'); + $timeout(function() { + scope.$eval(attrs.focused + '=false'); + }); }); scope.$eval(attrs.focused + '=true') } -- cgit v1.2.3