From e4016792dd3da16e858a47f855388e0fc91b5341 Mon Sep 17 00:00:00 2001 From: James Bergstra Date: Thu, 21 Feb 2013 13:16:26 -0500 Subject: [PATCH] FIX: indent level of sort_fragments --- js/reveal.js | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 15cfbae..ded2e86 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -138,30 +138,31 @@ var Reveal = (function(){ handled: false, threshold: 80 }; - /** - * Return a sorted fragments list, ordered by an increasing "fragment-pos" attribute. - * - * Fragments will be revealed in the order that they are returned by - * this function, so you can use "fragment-pos" attributes to control - * the order of fragment appearance. - * - * To maintain a sensible default fragment order, fragments are presumed - * to be passed in document order. This function adds a "fragment-pos" - * attribute to each node if such an attribute is not already present, - * and sets that attribute to an integer value which is the position of - * the fragment within the fragments list. - * - */ - function sort_fragments( fragments ) { - var a = toArray(fragments) - a.forEach( function (el, idx) { - if (!el.hasAttribute('fragment-pos')) { - el.setAttribute('fragment-pos', idx) }}) - a.sort(function(l, r) { - return l.getAttribute( 'fragment-pos' ) - - r.getAttribute( 'fragment-pos') }) - return a - } + + /** + * Return a sorted fragments list, ordered by an increasing "fragment-pos" attribute. + * + * Fragments will be revealed in the order that they are returned by + * this function, so you can use "fragment-pos" attributes to control + * the order of fragment appearance. + * + * To maintain a sensible default fragment order, fragments are presumed + * to be passed in document order. This function adds a "fragment-pos" + * attribute to each node if such an attribute is not already present, + * and sets that attribute to an integer value which is the position of + * the fragment within the fragments list. + * + */ + function sort_fragments( fragments ) { + var a = toArray(fragments) + a.forEach( function (el, idx) { + if (!el.hasAttribute('fragment-pos')) { + el.setAttribute('fragment-pos', idx) }}) + a.sort(function(l, r) { + return l.getAttribute( 'fragment-pos' ) + - r.getAttribute( 'fragment-pos') }) + return a + } /** * Starts up the presentation if the client is capable.