2020-05-22 16:26:05 +00:00
|
|
|
var ThreadItem = require( './ThreadItem.js' );
|
|
|
|
|
2020-06-25 12:23:17 +00:00
|
|
|
/**
|
|
|
|
* A heading item
|
|
|
|
*
|
|
|
|
* @class HeadingItem
|
|
|
|
* @extends {ThreadItem}
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} range
|
|
|
|
* @param {boolean} [placeholderHeading] Item doesn't correspond to a real heading (e.g. 0th section)
|
|
|
|
*/
|
2020-05-22 16:26:05 +00:00
|
|
|
function HeadingItem( range, placeholderHeading ) {
|
|
|
|
// Parent constructor
|
|
|
|
HeadingItem.super.call( this, 'heading', 0, range );
|
|
|
|
|
2020-06-25 12:23:17 +00:00
|
|
|
// TODO: Should probably always initialise, but our tests assert it is unset
|
2020-05-22 16:26:05 +00:00
|
|
|
if ( placeholderHeading ) {
|
|
|
|
this.placeholderHeading = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OO.inheritClass( HeadingItem, ThreadItem );
|
|
|
|
|
|
|
|
module.exports = HeadingItem;
|