1
0
Fork 0

GeneralStepUi answer styling method extraction

This is just to enable some sort of testing without instantiating the entire
class and navigating a maze of methods.

* ui/step/GeneralStepUi.js (answerDataUpdate): Added
  (_processAnswerFields): Extracted function into answerDataUpate
master
Mike Gerwitz 2016-06-17 12:01:12 -04:00
parent a6a3ffdcc4
commit 7a1e1a68e3
1 changed files with 23 additions and 8 deletions

View File

@ -407,14 +407,7 @@ module.exports = Class( 'StepUi' )
return;
}
// give the UI a chance to update the DOM; otherwise, the
// answer elements we update may no longer be used (this also
// has performance benefits since it allows repainting before
// potentially heavy processing)
setTimeout( function()
{
_self._updateAnswerFieldData( data );
}, 25 );
_self.answerDataUpdate( data );
} );
doUpdate( bucket.getData() );
@ -442,6 +435,28 @@ module.exports = Class( 'StepUi' )
},
/**
* Update and style answer field data
*
* @param {Object} data key-value diff
*
* @return {undefined}
*/
'virtual protected answerDataUpdate': function( data )
{
var _self = this;
// give the UI a chance to update the DOM; otherwise, the
// answer elements we update may no longer be used (this also
// has performance benefits since it allows repainting before
// potentially heavy processing)
setTimeout( function()
{
_self._updateAnswerFieldData( data );
}, 25 );
},
/**
* Update DOM answer fields with respective datum in diff DATA
*