function saveDetails()
    {
        // Do this on a timer so that we don't always save, just when user 
        //  has stopped typing / interacting with the form
        if (saveTimerHandle) {
            clearTimeout(saveTimerHandle);
        }
        saveTimerHandle = setTimeout(function()
        {
            // Collect data
            var details = {};
            $fields.each(function (i, el) 
            {
                var $el = $(el);
                details[$el.attr('id')] = $el.val();
            });
            console.log('saveDetails:', details);

            // Save to local storage
            var data = {};
            data[KEY_STORAGE_BUGANIZER] = details;
            chrome.storage.local.set(data, function() 
            {
                if (chrome.runtime.lastError) {	// Check for errors
                    console.log(chrome.runtime.lastError);
                } else {	// Success
                    saveTimerHandle = null;     // Clear saving timer handle
                }
            });
        }, TIME_SAVE_DELAY);
    }
// Save details so user doesn't lose it
Save details so user doesn't lose it
Save details so user doesn ' t lose it
function saveDetails()
    {
        if (saveTimerHandle) {
            clearTimeout(saveTimerHandle);
        }
        saveTimerHandle = setTimeout(function()
        {
            var details = {};
            $fields.each(function (i, el) 
            {
                var $el = $(el);
                details[$el.attr('id')] = $el.val();
            });
            console.log('saveDetails:', details);
            var data = {};
            data[KEY_STORAGE_BUGANIZER] = details;
            chrome.storage.local.set(data, function() 
            {
                if (chrome.runtime.lastError) {	
                    console.log(chrome.runtime.lastError);
                } else {	
                    saveTimerHandle = null;     
                }
            });
        }, TIME_SAVE_DELAY);
    }
function saveDetails ( ) { if ( saveTimerHandle ) { clearTimeout ( saveTimerHandle ) ; } saveTimerHandle = setTimeout ( function ( ) { var details = { } ; $fields . each ( function ( i , el ) { var $el = $ ( el ) ; details [ $el . attr ( 'id' ) ] = $el . val ( ) ; } ) ; console . log ( 'saveDetails:' , details ) ; var data = { } ; data [ KEY_STORAGE_BUGANIZER ] = details ; chrome . storage . local . set ( data , function ( ) { if ( chrome . runtime . lastError ) { console . log ( chrome . runtime . lastError ) ; } else { saveTimerHandle = null ; } } ) ; } , TIME_SAVE_DELAY ) ; }
Save details so user doesn't lose it
Save details so user doesn ' t lose it
// Do this on a timer so that we don't always save, just when user  //  has stopped typing / interacting with the form // Collect data // Save to local storage // Check for errors // Success // Clear saving timer handle