diff --git src/js/media/views/button.js src/js/media/views/button.js
index 8f1af79d85..a2d1a15e59 100644
|
|
var Button = wp.media.View.extend(/** @lends wp.media.view.Button.prototype */{ |
24 | 24 | disabled: false |
25 | 25 | }, |
26 | 26 | |
27 | | initialize: function() { |
| 27 | initialize: function( view, button_options ) { |
28 | 28 | /** |
29 | 29 | * Create a model with the provided `defaults`. |
30 | 30 | * |
… |
… |
var Button = wp.media.View.extend(/** @lends wp.media.view.Button.prototype */{ |
32 | 32 | */ |
33 | 33 | this.model = new Backbone.Model( this.defaults ); |
34 | 34 | |
| 35 | if ( ! _.isUndefined( button_options ) ) { |
| 36 | this.options = _.defaults( button_options, this.options ); |
| 37 | } |
| 38 | |
35 | 39 | // If any of the `options` have a key from `defaults`, apply its |
36 | 40 | // value to the `model` and remove it from the `options object. |
37 | 41 | _.each( this.defaults, function( def, key ) { |
diff --git src/js/media/views/toolbar.js src/js/media/views/toolbar.js
index 258d12697a..8477e3f508 100644
|
|
Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ |
89 | 89 | } else { |
90 | 90 | if ( ! ( view instanceof Backbone.View ) ) { |
91 | 91 | view.classes = [ 'media-button-' + id ].concat( view.classes || [] ); |
92 | | view = new wp.media.view.Button( view ).render(); |
| 92 | view = new wp.media.view.Button( view, this.controller.options.button ).render(); |
93 | 93 | } |
94 | 94 | |
95 | 95 | view.controller = view.controller || this.controller; |