sampleapp/www/todos.js
function(e) {
      var tooltip = this.$(".ui-tooltip-top");
      var val = this.input.val();
      tooltip.fadeOut();
      if (this.tooltipTimeout) clearTimeout(this.tooltipTimeout);
      if (val == '' || val == this.input.attr('placeholder')) return;
      var show = function(){ tooltip.show().fadeIn(); };
      this.tooltipTimeout = _.delay(show, 1000);
    }
function(e) {
      var tooltip = this.$(".ui-tooltip-top");
      var val = this.input.val();
      tooltip.fadeOut();
      if (this.tooltipTimeout) clearTimeout(this.tooltipTimeout);
      if (val == '' || val == this.input.attr('placeholder')) return;
      var show = function(){ tooltip.show().fadeIn(); };
      this.tooltipTimeout = _.delay(show, 1000);
    }
function ( e ) { var tooltip = this . $ ( ".ui-tooltip-top" ) ; var val = this . input . val ( ) ; tooltip . fadeOut ( ) ; if ( this . tooltipTimeout ) clearTimeout ( this . tooltipTimeout ) ; if ( val == '' || val == this . input . attr ( 'placeholder' ) ) return ; var show = function ( ) { tooltip . show ( ) . fadeIn ( ) ; } ; this . tooltipTimeout = _ . delay ( show , 1000 ) ; }
Lazily show the tooltip that tells you to press `enter` to save a new todo item, after one second.
Lazily show the tooltip that tells you to press enter to save a new todo item after one second .