Changeset 42037
- Timestamp:
- 10/29/2017 12:14:06 AM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r42035 r42037 3402 3402 defaultActiveArguments: { duration: 'fast', completeCallback: $.noop }, 3403 3403 3404 /** 3405 * Default params. 3406 * 3407 * @since 4.9.0 3408 * @var {object} 3409 */ 3404 3410 defaults: { 3405 3411 label: '', -
trunk/src/wp-includes/js/customize-selective-refresh.js
r41868 r42037 33 33 * @augments wp.customize.Class 34 34 * @since 4.5.0 35 *36 * @param {string} id Unique identifier for the control instance.37 * @param {object} options Options hash for the control instance.38 * @param {object} options.params39 * @param {string} options.params.type Type of partial (e.g. nav_menu, widget, etc)40 * @param {string} options.params.selector jQuery selector to find the container element in the page.41 * @param {array} options.params.settings The IDs for the settings the partial relates to.42 * @param {string} options.params.primarySetting The ID for the primary setting the partial renders.43 * @param {bool} options.params.fallbackRefresh Whether to refresh the entire preview in case of a partial refresh failure.44 35 */ 45 36 Partial = self.Partial = api.Class.extend(/** @lends wp.customize.SelectiveRefresh.Partial.prototype */{ … … 48 39 49 40 /** 41 * Default params. 42 * 43 * @since 4.9.0 44 * @var {object} 45 */ 46 defaults: { 47 selector: null, 48 primarySetting: null, 49 containerInclusive: false, 50 fallbackRefresh: true // Note this needs to be false in a front-end editing context. 51 }, 52 53 /** 50 54 * Constructor. 51 55 * 52 56 * @since 4.5.0 53 57 * 54 * @param {string} id - Partial ID. 55 * @param {Object} options 56 * @param {Object} options.params 58 * @param {string} id - Unique identifier for the partial instance. 59 * @param {object} options - Options hash for the partial instance. 60 * @param {string} options.type - Type of partial (e.g. nav_menu, widget, etc) 61 * @param {string} options.selector - jQuery selector to find the container element in the page. 62 * @param {array} options.settings - The IDs for the settings the partial relates to. 63 * @param {string} options.primarySetting - The ID for the primary setting the partial renders. 64 * @param {bool} options.fallbackRefresh - Whether to refresh the entire preview in case of a partial refresh failure. 65 * @param {object} [options.params] - Deprecated wrapper for the above properties. 57 66 */ 58 67 initialize: function( id, options ) { … … 63 72 partial.params = _.extend( 64 73 { 65 selector: null, 66 settings: [], 67 primarySetting: null, 68 containerInclusive: false, 69 fallbackRefresh: true // Note this needs to be false in a front-end editing context. 74 settings: [] 70 75 }, 71 options.params || {} 76 partial.defaults, 77 options.params || options 72 78 ); 73 79 … … 918 924 if ( ! partial ) { 919 925 Constructor = self.partialConstructor[ data.type ] || self.Partial; 920 partial = new Constructor( id, { params: data } ); 926 partial = new Constructor( 927 id, 928 _.extend( { params: data }, data ) // Inclusion of params alias is for back-compat for custom partials that expect to augment this property. 929 ); 921 930 self.partial.add( partial ); 922 931 } else {
Note: See TracChangeset
for help on using the changeset viewer.