function Delayed(action, timeout) {
        this.schedule = function () {
            this.cancel();
            this.token = window.setTimeout(function () {
                this.token = null;
                action();
            }.bind(this), timeout);
            logger("Scheduled %s",this.token)
        };
        this.cancel = function () {
            if (this.token != null) {
                logger("Cancelling %s",this.token);
                window.clearTimeout(this.token);
            }
            this.token = null;
        };
    }
/**
     * Wraps a delayed action and its cancellation.
     */
Wraps a delayed action and its cancellation.
Wraps a delayed action and its cancellation .
function Delayed(action, timeout) {
        this.schedule = function () {
            this.cancel();
            this.token = window.setTimeout(function () {
                this.token = null;
                action();
            }.bind(this), timeout);
            logger("Scheduled %s",this.token)
        };
        this.cancel = function () {
            if (this.token != null) {
                logger("Cancelling %s",this.token);
                window.clearTimeout(this.token);
            }
            this.token = null;
        };
    }
function Delayed ( action , timeout ) { this . schedule = function ( ) { this . cancel ( ) ; this . token = window . setTimeout ( function ( ) { this . token = null ; action ( ) ; } . bind ( this ) , timeout ) ; logger ( "Scheduled %s" , this . token ) } ; this . cancel = function ( ) { if ( this . token != null ) { logger ( "Cancelling %s" , this . token ) ; window . clearTimeout ( this . token ) ; } this . token = null ; } ; }
Wraps a delayed action and its cancellation.
Wraps a delayed action and its cancellation .