Accept jQuery in GeneralStepUi
This defaults to the global jQuery just so we don't break everything (BC); that'll be removed in the future. * src/ui/step/GeneralStepUi.js (__construct): Accept jQuery. (setContent): Use jQuery instance passed via ctormaster
parent
72f29a9734
commit
66f78c8886
|
@ -101,6 +101,12 @@ module.exports = Class( 'GeneralStepUi' )
|
|||
*/
|
||||
step: null,
|
||||
|
||||
/**
|
||||
* jQuery instance
|
||||
* @type {jQuery}
|
||||
*/
|
||||
'private _jquery': null,
|
||||
|
||||
/**
|
||||
* Step data (DOM representation)
|
||||
* @type {jQuery}
|
||||
|
@ -187,17 +193,32 @@ module.exports = Class( 'GeneralStepUi' )
|
|||
* until the data loading is complete. That is when the callback will be
|
||||
* triggered.
|
||||
*
|
||||
* TODO: Remove jQuery
|
||||
*
|
||||
* @param {Step} step step to render
|
||||
* @param {ElementStyler} styler element styler
|
||||
* @param {BucketDataValidator} formatter validator/formatter
|
||||
* @param {jQuery} jquery jQuery instance
|
||||
*
|
||||
* @return {undefined}
|
||||
*/
|
||||
'public __construct': function(
|
||||
step,
|
||||
styler,
|
||||
formatter
|
||||
formatter,
|
||||
jquery
|
||||
)
|
||||
{
|
||||
this.step = step;
|
||||
this.styler = styler;
|
||||
this._formatter = formatter;
|
||||
|
||||
// TODO: transition code; remove default
|
||||
this._jquery = jquery || (
|
||||
( typeof $ !== 'undefined' )
|
||||
? $
|
||||
: undefined
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
|
@ -246,7 +267,7 @@ module.exports = Class( 'GeneralStepUi' )
|
|||
'public setContent': function( content )
|
||||
{
|
||||
// TODO: transition away from jQuery
|
||||
this.$content = $( content );
|
||||
this.$content = this._jquery( content );
|
||||
|
||||
this._processAnswerFields();
|
||||
|
||||
|
|
Loading…
Reference in New Issue