Permalink
Browse files

Merge branch 'master' into vo_usability

  • Loading branch information...
2 parents 639c888 + 8f0c0e4 commit ff87b1f452c5174146be09fb64c24ae2ad7c9c0b @adahmash adahmash committed Apr 17, 2012
Showing with 19 additions and 4 deletions.
  1. +19 −4 app/assets/javascripts/application.js
@@ -787,10 +787,25 @@ addthis.addEventListener('addthis.menu.share',shareEventHandler);
});
$e.find("li>input").focusout(function(e){
var $this = $(this);
- if ( $this.val() ) {
- var t= $this.val();
+ (function($this){
+ var old_val = $this.val();
+ setTimeout(function(){
+ if ( $this.val() && old_val == $this.val() ) {
+ var t= $this.val();
+ addTag(t);
+ $this.val("");
+ }
+ }, 110);
+ })($this);
+ });
+
+ var $e_input = $e.find("li>input");
+
+ $e.parents("form").submit(function(){
+ if ( $e_input.val() ) {
+ var t= $e_input.val();
addTag(t);
- $this.val("");
+ $e_input.val("");
}
});
@@ -805,7 +820,7 @@ addthis.addEventListener('addthis.menu.share',shareEventHandler);
return false;
},
serviceUrl:'/tags/suggest',
- deferRequestBy: 100, //miliseconds
+ deferRequestBy: 10, //miliseconds
//lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values
});

0 comments on commit ff87b1f

Please sign in to comment.