| | 1 | /** |
| | 2 | * wp.media.view.Heading |
| | 3 | * |
| | 4 | * @class |
| | 5 | * @augments wp.media.View |
| | 6 | * @augments wp.Backbone.View |
| | 7 | * @augments Backbone.View |
| | 8 | */ |
| | 9 | var Heading = wp.media.View.extend({ |
| | 10 | tagName: function() { |
| | 11 | return this.options.level || 'h1' |
| | 12 | }, |
| | 13 | className: 'media-views-heading', |
| | 14 | |
| | 15 | initialize: function() { |
| | 16 | |
| | 17 | if ( this.options.cssclass ) { |
| | 18 | this.$el.addClass( this.options.cssclass ); |
| | 19 | } |
| | 20 | |
| | 21 | this.text = this.options.text; |
| | 22 | }, |
| | 23 | |
| | 24 | render: function() { |
| | 25 | this.$el.html( this.text ); |
| | 26 | return this; |
| | 27 | } |
| | 28 | }); |
| | 29 | |
| | 30 | module.exports = Heading; |