mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
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:
@@ -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();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user