/*! * VisualEditor UserInterface MWTocWidget class. * * @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Creates a ve.ui.MWTocWidget object. * * @class * @extends OO.ui.Widget * * @constructor * @param {ve.ui.Surface} surface * @param {Object} [config] Configuration options */ ve.ui.MWTocWidget = function VeUiMWTocWidget( surface, config ) { var widget = this; // Parent constructor OO.ui.Widget.call( this, config ); // Properties this.surface = surface; this.doc = surface.getModel().getDocument(); this.metaList = surface.getModel().metaList; // Topic level 0 lives inside of a toc item this.topics = new ve.ui.MWTocItemWidget(); // Place for a cloned previous toc to live while rebuilding. this.$tempTopics = this.$( '