src/includes/suggestions.js
function () {
        var that = this,
            events = 'mouseover focus keydown',
            timer,
            callback = function () {
                that.initializer.resolve();
                that.enable();
            };

        that.initializer.always(function(){
            that.el.off(events, callback);
            clearInterval(timer);
        });

        that.disabled = true;
        that.el.on(events, callback);
        timer = setInterval(function(){
            if (that.el.is(':visible')) {
                callback();
            }
        }, that.options.initializeInterval);
    }
function () {
        var that = this,
            events = 'mouseover focus keydown',
            timer,
            callback = function () {
                that.initializer.resolve();
                that.enable();
            };

        that.initializer.always(function(){
            that.el.off(events, callback);
            clearInterval(timer);
        });

        that.disabled = true;
        that.el.on(events, callback);
        timer = setInterval(function(){
            if (that.el.is(':visible')) {
                callback();
            }
        }, that.options.initializeInterval);
    }
function ( ) { var that = this , events = 'mouseover focus keydown' , timer , callback = function ( ) { that . initializer . resolve ( ) ; that . enable ( ) ; } ; that . initializer . always ( function ( ) { that . el . off ( events , callback ) ; clearInterval ( timer ) ; } ) ; that . disabled = true ; that . el . on ( events , callback ) ; timer = setInterval ( function ( ) { if ( that . el . is ( ':visible' ) ) { callback ( ) ; } } , that . options . initializeInterval ) ; }
Initialize when element is firstly interacted
Initialize when element is firstly interacted