Permalink
Browse files

Select text on focus (unfortunatly I had to take jquery-1.7.1.min.js …

…as a new reference)
  • Loading branch information...
1 parent 62fa615 commit 02c7ab142b9fccb82176d132386e86d7f42e4bfe @cburgdorf cburgdorf committed Mar 1, 2012
@@ -44,6 +44,7 @@
</div>
<script src="js/booter.js"></script>
<script src="js/lib/angular/angular.min.js" ng:autobind></script>
+ <script src="js/lib/jquery-1.7.1.min.js"></script>
<script src="js/controllers.js"></script>
<script src="js/directive.js"></script>
</body>
@@ -22,10 +22,12 @@ angular.directive('my:dblclick', function(expression, compiledElement) {
});
angular.directive("my:focus", function(expression, compiledElement){
+
return function(element){
this.$watch(expression, function(){
if(angular.formatter.boolean.parse(expression)){
element[0].focus();
+ $(element[0]).select();
}
}, element);
};
Oops, something went wrong.

0 comments on commit 02c7ab1

Please sign in to comment.