Skip to content
Browse files

Factor out showIncremental function

  • Loading branch information...
1 parent df260ea commit dc1b76cb02dc2ae84332cba2e6070c2aca1cd41f @bgentry bgentry committed Sep 26, 2011
Showing with 12 additions and 7 deletions.
  1. +12 −7 public/js/showoff.js
View
19 public/js/showoff.js
@@ -252,6 +252,16 @@ function determineIncremental()
})
}
+function showIncremental(incr)
+{
+ elem = incrElem.eq(incrCurr)
+ if (incrCode && elem.hasClass('command')) {
+ incrElem.eq(incrCurr).css('visibility', 'visible').jTypeWriter({duration:1.0})
+ } else {
+ incrElem.eq(incrCurr).css('visibility', 'visible')
+ }
+}
+
function prevStep()
{
@@ -277,17 +287,12 @@ function nextStep()
slidenum++
return showSlide()
} else {
- elem = incrElem.eq(incrCurr)
- if (incrCode && elem.hasClass('command')) {
- incrElem.eq(incrCurr).css('visibility', 'visible').jTypeWriter({duration:1.0})
- } else {
- incrElem.eq(incrCurr).css('visibility', 'visible')
- }
- incrCurr++;
+ showIncremental(incrCurr);
var incrEvent = jQuery.Event("showoff:incr");
incrEvent.slidenum = slidenum;
incrEvent.incr = incrCurr;
$(currentSlide).find(".content").trigger(incrEvent);
+ incrCurr++;
}
}

0 comments on commit dc1b76c

Please sign in to comment.
Something went wrong with that request. Please try again.