r94179 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94178‎ | r94179 | r94180 >
Date:18:06, 10 August 2011
Author:inez
Status:deferred
Tags:
Comment:
Implementation of getLevel method that gets a depth level for the item in list.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.ListBlockItem.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.ListBlockItem.js
@@ -147,6 +147,30 @@
148148 };
149149
150150 /**
 151+ * Gets a depth level for the item in list.
 152+ * Example:
 153+ *
 154+ * # level 0
 155+ * ## level 1
 156+ * # level 0
 157+ * ### level 2
 158+ *
 159+ * @method
 160+ * @returns {Integer} Depth level
 161+ */
 162+es.ListBlockItem.prototype.getLevel = function( position ) {
 163+ var start = this.list.item,
 164+ level = 0;
 165+
 166+ while ( start ) {
 167+ start = start.list.item;
 168+ level++;
 169+ }
 170+
 171+ return level;
 172+};
 173+
 174+/**
151175 * Renders content and sub-lists.
152176 *
153177 * @method

Status & tagging log