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
|
2020-08-26 22:46:34 +00:00
|
|
|
* @extends ThreadItem
|
2020-06-25 12:23:17 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {Object} range
|
2020-10-01 19:36:11 +00:00
|
|
|
* @param {number} headingLevel Heading level (1-6)
|
2020-06-25 12:23:17 +00:00
|
|
|
* @param {boolean} [placeholderHeading] Item doesn't correspond to a real heading (e.g. 0th section)
|
|
|
|
*/
|
2020-10-01 19:36:11 +00:00
|
|
|
function HeadingItem( range, headingLevel, placeholderHeading ) {
|
2020-05-22 16:26:05 +00:00
|
|
|
// Parent constructor
|
|
|
|
HeadingItem.super.call( this, 'heading', 0, range );
|
|
|
|
|
2020-10-01 19:36:11 +00:00
|
|
|
this.headingLevel = headingLevel;
|
2020-10-07 14:45:19 +00:00
|
|
|
this.placeholderHeading = !!placeholderHeading;
|
2020-05-22 16:26:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
OO.inheritClass( HeadingItem, ThreadItem );
|
|
|
|
|
|
|
|
module.exports = HeadingItem;
|