Merge pull request #4887 from TheHollidayInn/focus-textarea-on-pm

Added focus directive to focus textarea for a private message model box
This commit is contained in:
Alys
2015-04-04 01:45:30 +10:00
2 changed files with 16 additions and 3 deletions

View File

@@ -167,7 +167,7 @@ habitrpg
templateUrl: 'template/popover/popover-html.html'
};
}])
.directive( 'popoverHtml', [ '$compile', '$timeout', '$parse', '$window', '$tooltip',
.directive( 'popoverHtml', [ '$compile', '$timeout', '$parse', '$window', '$tooltip',
function ( $compile, $timeout, $parse, $window, $tooltip ) {
return $tooltip( 'popoverHtml', 'popover', 'click' );
}
@@ -183,3 +183,16 @@ habitrpg
" </div>\n" +
"</div>\n");
}]);
habitrpg.directive('focusMe', function($timeout, $parse) {
return {
link: function(scope, element, attrs) {
var model = $parse(attrs.focusMe);
scope.$watch(model, function(value) {
$timeout(function() {
element[0].focus();
});
});
}
};
});