reveal.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. /*!
  2. * reveal.js 1.3
  3. * http://lab.hakim.se/reveal-js
  4. * MIT licensed
  5. *
  6. * Copyright (C) 2011 Hakim El Hattab, http://hakim.se
  7. */
  8. var Reveal = (function(){
  9. var HORIZONTAL_SLIDES_SELECTOR = '#reveal .slides>section',
  10. VERTICAL_SLIDES_SELECTOR = '#reveal .slides>section.present>section',
  11. // The horizontal and verical index of the currently active slide
  12. indexh = 0,
  13. indexv = 0,
  14. // Configurations options, can be overridden at initialization time
  15. config = {
  16. controls: false,
  17. progress: false,
  18. history: false,
  19. transition: 'default',
  20. theme: 'default',
  21. mouseWheel: true,
  22. rollingLinks: true
  23. },
  24. // Slides may hold a data-state attribute which we pick up and apply
  25. // as a class to the body. This list contains the combined state of
  26. // all current slides.
  27. state = [],
  28. // Cached references to DOM elements
  29. dom = {},
  30. // Detect support for CSS 3D transforms
  31. supports3DTransforms = document.body.style['perspectiveProperty'] !== undefined ||
  32. document.body.style['WebkitPerspective'] !== undefined ||
  33. document.body.style['MozPerspective'] !== undefined ||
  34. document.body.style['msPerspective'] !== undefined,
  35. supports2DTransforms = document.body.style['transformProperty'] !== undefined ||
  36. document.body.style['WebkitTransform'] !== undefined ||
  37. document.body.style['MozTransform'] !== undefined ||
  38. document.body.style['msTransform'] !== undefined ||
  39. document.body.style['OTransform'] !== undefined,
  40. // Throttles mouse wheel navigation
  41. mouseWheelTimeout = 0,
  42. // Delays updates to the URL due to a Chrome thumbnailer bug
  43. writeURLTimeout = 0;
  44. /**
  45. * Starts up the slideshow by applying configuration
  46. * options and binding various events.
  47. */
  48. function initialize( options ) {
  49. if( !supports2DTransforms && !supports3DTransforms ) {
  50. document.body.setAttribute( 'class', 'no-transforms' );
  51. // If the browser doesn't support transforms we won't be
  52. // using JavaScript to control the presentation
  53. return;
  54. }
  55. // Cache references to DOM elements
  56. dom.wrapper = document.querySelector( '#reveal' );
  57. dom.progress = document.querySelector( '#reveal .progress' );
  58. dom.progressbar = document.querySelector( '#reveal .progress span' );
  59. dom.controls = document.querySelector( '#reveal .controls' );
  60. dom.controlsLeft = document.querySelector( '#reveal .controls .left' );
  61. dom.controlsRight = document.querySelector( '#reveal .controls .right' );
  62. dom.controlsUp = document.querySelector( '#reveal .controls .up' );
  63. dom.controlsDown = document.querySelector( '#reveal .controls .down' );
  64. // Bind all view events
  65. document.addEventListener('keydown', onDocumentKeyDown, false);
  66. document.addEventListener('touchstart', onDocumentTouchStart, false);
  67. window.addEventListener('hashchange', onWindowHashChange, false);
  68. dom.controlsLeft.addEventListener('click', preventAndForward( navigateLeft ), false);
  69. dom.controlsRight.addEventListener('click', preventAndForward( navigateRight ), false);
  70. dom.controlsUp.addEventListener('click', preventAndForward( navigateUp ), false);
  71. dom.controlsDown.addEventListener('click', preventAndForward( navigateDown ), false);
  72. // Copy options over to our config object
  73. extend( config, options );
  74. // Fall back on the 2D transform theme 'linear'
  75. if( supports3DTransforms === false ) {
  76. config.transition = 'linear';
  77. }
  78. if( config.controls ) {
  79. dom.controls.style.display = 'block';
  80. }
  81. if( config.progress ) {
  82. dom.progress.style.display = 'block';
  83. }
  84. if( config.transition !== 'default' ) {
  85. dom.wrapper.classList.add( config.transition );
  86. }
  87. if( config.theme !== 'default' ) {
  88. dom.wrapper.classList.add( config.theme );
  89. }
  90. if( config.mouseWheel ) {
  91. document.addEventListener('DOMMouseScroll', onDocumentMouseScroll, false); // FF
  92. document.addEventListener('mousewheel', onDocumentMouseScroll, false);
  93. }
  94. if( config.rollingLinks ) {
  95. // Add some 3D magic to our anchors
  96. linkify();
  97. }
  98. // Read the initial hash
  99. readURL();
  100. }
  101. /**
  102. * Extend object a with the properties of object b.
  103. * If there's a conflict, object b takes precedence.
  104. */
  105. function extend( a, b ) {
  106. for( var i in b ) {
  107. a[ i ] = b[ i ];
  108. }
  109. }
  110. /**
  111. * Prevents an events defaults behavior calls the
  112. * specified delegate.
  113. *
  114. * @param {Function} delegate The method to call
  115. * after the wrapper has been executed
  116. */
  117. function preventAndForward( delegate ) {
  118. return function( event ) {
  119. event.preventDefault();
  120. delegate.call();
  121. }
  122. }
  123. /**
  124. * Handler for the document level 'keydown' event.
  125. *
  126. * @param {Object} event
  127. */
  128. function onDocumentKeyDown( event ) {
  129. // FFT: Use document.querySelector( ':focus' ) === null
  130. // instead of checking contentEditable?
  131. if( event.target.contentEditable === 'inherit' ) {
  132. if( event.keyCode >= 33 && event.keyCode <= 40 ) {
  133. switch( event.keyCode ) {
  134. case 33: navigatePrev(); break; // prev for wireless presenter (PgUp)
  135. case 34: navigateNext(); break; // next for wireless presenter (PgDn)
  136. case 37: navigateLeft(); break; // left
  137. case 39: navigateRight(); break; // right
  138. case 38: navigateUp(); break; // up
  139. case 40: navigateDown(); break; // down
  140. }
  141. event.preventDefault();
  142. }
  143. // Space bar
  144. else if ( event.keyCode === 32 && supports3DTransforms ) {
  145. if( overviewIsActive() ) {
  146. deactivateOverview();
  147. }
  148. else {
  149. activateOverview();
  150. }
  151. event.preventDefault();
  152. }
  153. }
  154. }
  155. /**
  156. * Handler for the document level 'touchstart' event.
  157. *
  158. * This enables very basic tap interaction for touch
  159. * devices. Added mainly for performance testing of 3D
  160. * transforms on iOS but was so happily surprised with
  161. * how smoothly it runs so I left it in here. Apple +1
  162. *
  163. * @param {Object} event
  164. */
  165. function onDocumentTouchStart( event ) {
  166. // We're only interested in one point taps
  167. if (event.touches.length === 1) {
  168. // Never prevent taps on anchors and images
  169. if( event.target.tagName.toLowerCase() === 'a' || event.target.tagName.toLowerCase() === 'img' ) {
  170. return;
  171. }
  172. event.preventDefault();
  173. var point = {
  174. x: event.touches[0].clientX,
  175. y: event.touches[0].clientY
  176. };
  177. // Define the extent of the areas that may be tapped
  178. // to navigate
  179. var wt = window.innerWidth * 0.3;
  180. var ht = window.innerHeight * 0.3;
  181. if( point.x < wt ) {
  182. navigateLeft();
  183. }
  184. else if( point.x > window.innerWidth - wt ) {
  185. navigateRight();
  186. }
  187. else if( point.y < ht ) {
  188. navigateUp();
  189. }
  190. else if( point.y > window.innerHeight - ht ) {
  191. navigateDown();
  192. }
  193. slide();
  194. }
  195. }
  196. /**
  197. * Handles mouse wheel scrolling, throttled to avoid
  198. * skipping multiple slides.
  199. */
  200. function onDocumentMouseScroll( event ){
  201. clearTimeout( mouseWheelTimeout );
  202. mouseWheelTimeout = setTimeout( function() {
  203. var delta = event.detail || -event.wheelDelta;
  204. if( delta > 0 ) {
  205. navigateNext();
  206. }
  207. else {
  208. navigatePrev();
  209. }
  210. }, 100 );
  211. }
  212. /**
  213. * Handler for the window level 'hashchange' event.
  214. *
  215. * @param {Object} event
  216. */
  217. function onWindowHashChange( event ) {
  218. readURL();
  219. }
  220. /**
  221. * Wrap all links in 3D goodness.
  222. */
  223. function linkify() {
  224. if( supports3DTransforms ) {
  225. var nodes = document.querySelectorAll( '#reveal .slides section a:not(.image)' );
  226. for( var i = 0, len = nodes.length; i < len; i++ ) {
  227. var node = nodes[i];
  228. if( node.textContent && !node.querySelector( 'img' ) && ( !node.className || !node.classList.contains( node, 'roll' ) ) ) {
  229. node.classList.add( 'roll' );
  230. node.innerHTML = '<span data-title="'+ node.text +'">' + node.innerHTML + '</span>';
  231. }
  232. };
  233. }
  234. }
  235. /**
  236. * Displays the overview of slides (quick nav) by
  237. * scaling down and arranging all slide elements.
  238. *
  239. * Experimental feature, might be dropped if perf
  240. * can't be improved.
  241. */
  242. function activateOverview() {
  243. dom.wrapper.classList.add( 'overview' );
  244. var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
  245. for( var i = 0, len1 = horizontalSlides.length; i < len1; i++ ) {
  246. var hslide = horizontalSlides[i],
  247. htransform = 'translateZ(-2500px) translate(' + ( ( i - indexh ) * 105 ) + '%, 0%)';
  248. hslide.setAttribute( 'data-index-h', i );
  249. hslide.style.display = 'block';
  250. hslide.style.WebkitTransform = htransform;
  251. hslide.style.MozTransform = htransform;
  252. hslide.style.msTransform = htransform;
  253. hslide.style.OTransform = htransform;
  254. hslide.style.transform = htransform;
  255. if( !hslide.classList.contains( 'stack' ) ) {
  256. // Navigate to this slide on click
  257. hslide.addEventListener( 'click', onOverviewSlideClicked, true );
  258. }
  259. var verticalSlides = Array.prototype.slice.call( hslide.querySelectorAll( 'section' ) );
  260. for( var j = 0, len2 = verticalSlides.length; j < len2; j++ ) {
  261. var vslide = verticalSlides[j],
  262. vtransform = 'translate(0%, ' + ( ( j - indexv ) * 105 ) + '%)';
  263. vslide.setAttribute( 'data-index-h', i );
  264. vslide.setAttribute( 'data-index-v', j );
  265. vslide.style.display = 'block';
  266. vslide.style.WebkitTransform = vtransform;
  267. vslide.style.MozTransform = vtransform;
  268. vslide.style.msTransform = vtransform;
  269. vslide.style.OTransform = vtransform;
  270. vslide.style.transform = vtransform;
  271. // Navigate to this slide on click
  272. vslide.addEventListener( 'click', onOverviewSlideClicked, true );
  273. }
  274. }
  275. }
  276. /**
  277. * Exits the slide overview and enters the currently
  278. * active slide.
  279. */
  280. function deactivateOverview() {
  281. dom.wrapper.classList.remove( 'overview' );
  282. var slides = Array.prototype.slice.call( document.querySelectorAll( '#reveal .slides section' ) );
  283. for( var i = 0, len = slides.length; i < len; i++ ) {
  284. var element = slides[i];
  285. // Resets all transforms to use the external styles
  286. element.style.WebkitTransform = '';
  287. element.style.MozTransform = '';
  288. element.style.msTransform = '';
  289. element.style.OTransform = '';
  290. element.style.transform = '';
  291. element.removeEventListener( 'click', onOverviewSlideClicked );
  292. }
  293. slide();
  294. }
  295. /**
  296. * Checks if the overview is currently active.
  297. *
  298. * @return {Boolean} true if the overview is active,
  299. * false otherwise
  300. */
  301. function overviewIsActive() {
  302. return dom.wrapper.classList.contains( 'overview' );
  303. }
  304. /**
  305. * Invoked when a slide is and we're in the overview.
  306. */
  307. function onOverviewSlideClicked( event ) {
  308. // TODO There's a bug here where the event listeners are not
  309. // removed after deactivating the overview.
  310. if( overviewIsActive() ) {
  311. event.preventDefault();
  312. deactivateOverview();
  313. indexh = this.getAttribute( 'data-index-h' );
  314. indexv = this.getAttribute( 'data-index-v' );
  315. slide();
  316. }
  317. }
  318. /**
  319. * Updates one dimension of slides by showing the slide
  320. * with the specified index.
  321. *
  322. * @param {String} selector A CSS selector that will fetch
  323. * the group of slides we are working with
  324. * @param {Number} index The index of the slide that should be
  325. * shown
  326. *
  327. * @return {Number} The index of the slide that is now shown,
  328. * might differ from the passed in index if it was out of
  329. * bounds.
  330. */
  331. function updateSlides( selector, index ) {
  332. // Select all slides and convert the NodeList result to
  333. // an array
  334. var slides = Array.prototype.slice.call( document.querySelectorAll( selector ) );
  335. if( slides.length ) {
  336. // Enforce max and minimum index bounds
  337. index = Math.max(Math.min(index, slides.length - 1), 0);
  338. for( var i = 0; i < slides.length; i++ ) {
  339. var slide = slides[i];
  340. // Optimization; hide all slides that are three or more steps
  341. // away from the present slide
  342. if( overviewIsActive() === false ) {
  343. slide.style.display = Math.abs( index - i ) > 3 ? 'none' : 'block';
  344. }
  345. slides[i].classList.remove( 'past' );
  346. slides[i].classList.remove( 'present' );
  347. slides[i].classList.remove( 'future' );
  348. if( i < index ) {
  349. // Any element previous to index is given the 'past' class
  350. slides[i].classList.add( 'past' );
  351. }
  352. else if( i > index ) {
  353. // Any element subsequent to index is given the 'future' class
  354. slides[i].classList.add( 'future' );
  355. }
  356. // If this element contains vertical slides
  357. if( slide.querySelector( 'section' ) ) {
  358. slides[i].classList.add( 'stack' );
  359. }
  360. }
  361. // Mark the current slide as present
  362. slides[index].classList.add( 'present' );
  363. // If this slide has a state associated with it, add it
  364. // onto the current state of the deck
  365. var slideState = slides[index].dataset.state;
  366. if( slideState ) {
  367. state = state.concat( slideState.split( ' ' ) );
  368. }
  369. }
  370. else {
  371. // Since there are no slides we can't be anywhere beyond the
  372. // zeroth index
  373. index = 0;
  374. }
  375. return index;
  376. }
  377. /**
  378. * Updates the visual slides to represent the currently
  379. * set indices.
  380. */
  381. function slide() {
  382. // Remember the state before this slide
  383. var stateBefore = state.concat();
  384. // Reset the state array
  385. state.length = 0;
  386. // Activate and transition to the new slide
  387. indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, indexh );
  388. indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, indexv );
  389. // Apply the new state
  390. stateLoop: for( var i = 0, len = state.length; i < len; i++ ) {
  391. // Check if this state existed on the previous slide. If it
  392. // did, we will avoid adding it repeatedly.
  393. for( var j = 0; j < stateBefore.length; j++ ) {
  394. if( stateBefore[j] === state[i] ) {
  395. stateBefore.splice( j, 1 );
  396. continue stateLoop;
  397. }
  398. }
  399. document.documentElement.classList.add( state[i] );
  400. // Dispatch custom event
  401. var event = document.createEvent( "HTMLEvents" );
  402. event.initEvent( state[i], true, true );
  403. document.dispatchEvent( event );
  404. }
  405. // Clean up the remaints of the previous state
  406. while( stateBefore.length ) {
  407. document.documentElement.classList.remove( stateBefore.pop() );
  408. }
  409. // Update progress if enabled
  410. if( config.progress ) {
  411. dom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px';
  412. }
  413. // Close the overview if it's active
  414. if( overviewIsActive() ) {
  415. activateOverview();
  416. }
  417. updateControls();
  418. clearTimeout( writeURLTimeout );
  419. writeURLTimeout = setTimeout( writeURL, 1500 );
  420. }
  421. /**
  422. * Updates the state and link pointers of the controls.
  423. */
  424. function updateControls() {
  425. var routes = availableRoutes();
  426. // Remove the 'enabled' class from all directions
  427. [ dom.controlsLeft, dom.controlsRight, dom.controlsUp, dom.controlsDown ].forEach( function( node ) {
  428. node.classList.remove( 'enabled' );
  429. } )
  430. if( routes.left ) dom.controlsLeft.classList.add( 'enabled' );
  431. if( routes.right ) dom.controlsRight.classList.add( 'enabled' );
  432. if( routes.up ) dom.controlsUp.classList.add( 'enabled' );
  433. if( routes.down ) dom.controlsDown.classList.add( 'enabled' );
  434. }
  435. /**
  436. * Determine what available routes there are for navigation.
  437. *
  438. * @return {Object} containing four booleans: left/right/up/down
  439. */
  440. function availableRoutes() {
  441. var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
  442. var verticalSlides = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR );
  443. return {
  444. left: indexh > 0,
  445. right: indexh < horizontalSlides.length - 1,
  446. up: indexv > 0,
  447. down: indexv < verticalSlides.length - 1
  448. };
  449. }
  450. /**
  451. * Reads the current URL (hash) and navigates accordingly.
  452. */
  453. function readURL() {
  454. // Break the hash down to separate components
  455. var bits = window.location.hash.slice(2).split('/');
  456. // Read the index components of the hash
  457. indexh = parseInt( bits[0] ) || 0 ;
  458. indexv = parseInt( bits[1] ) || 0 ;
  459. navigateTo( indexh, indexv );
  460. }
  461. /**
  462. * Updates the page URL (hash) to reflect the current
  463. * state.
  464. */
  465. function writeURL() {
  466. if( config.history ) {
  467. var url = '/';
  468. // Only include the minimum possible number of components in
  469. // the URL
  470. if( indexh > 0 || indexv > 0 ) url += indexh;
  471. if( indexv > 0 ) url += '/' + indexv;
  472. window.location.hash = url;
  473. }
  474. }
  475. /**
  476. * Navigate to the next slide fragment.
  477. *
  478. * @return {Boolean} true if there was a next fragment,
  479. * false otherwise
  480. */
  481. function nextFragment() {
  482. // Vertical slides:
  483. if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
  484. var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
  485. if( verticalFragments.length ) {
  486. verticalFragments[0].classList.add( 'visible' );
  487. return true;
  488. }
  489. }
  490. // Horizontal slides:
  491. else {
  492. var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
  493. if( horizontalFragments.length ) {
  494. horizontalFragments[0].classList.add( 'visible' );
  495. return true;
  496. }
  497. }
  498. return false;
  499. }
  500. /**
  501. * Navigate to the previous slide fragment.
  502. *
  503. * @return {Boolean} true if there was a previous fragment,
  504. * false otherwise
  505. */
  506. function previousFragment() {
  507. // Vertical slides:
  508. if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
  509. var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
  510. if( verticalFragments.length ) {
  511. verticalFragments[ verticalFragments.length - 1 ].classList.remove( 'visible' );
  512. return true;
  513. }
  514. }
  515. // Horizontal slides:
  516. else {
  517. var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
  518. if( horizontalFragments.length ) {
  519. horizontalFragments[ horizontalFragments.length - 1 ].classList.remove( 'visible' );
  520. return true;
  521. }
  522. }
  523. return false;
  524. }
  525. /**
  526. * Triggers a navigation to the specified indices.
  527. *
  528. * @param {Number} h The horizontal index of the slide to show
  529. * @param {Number} v The vertical index of the slide to show
  530. */
  531. function navigateTo( h, v ) {
  532. indexh = h === undefined ? indexh : h;
  533. indexv = v === undefined ? indexv : v;
  534. slide();
  535. }
  536. function navigateLeft() {
  537. // Prioritize hiding fragments
  538. if( overviewIsActive() || previousFragment() === false ) {
  539. indexh --;
  540. indexv = 0;
  541. slide();
  542. }
  543. }
  544. function navigateRight() {
  545. // Prioritize revealing fragments
  546. if( overviewIsActive() || nextFragment() === false ) {
  547. indexh ++;
  548. indexv = 0;
  549. slide();
  550. }
  551. }
  552. function navigateUp() {
  553. // Prioritize hiding fragments
  554. if( overviewIsActive() || previousFragment() === false ) {
  555. indexv --;
  556. slide();
  557. }
  558. }
  559. function navigateDown() {
  560. // Prioritize revealing fragments
  561. if( overviewIsActive() || nextFragment() === false ) {
  562. indexv ++;
  563. slide();
  564. }
  565. }
  566. /**
  567. * Navigates backwards, prioritized in the following order:
  568. * 1) Previous fragment
  569. * 2) Previous vertical slide
  570. * 3) Previous horizontal slide
  571. */
  572. function navigatePrev() {
  573. // Prioritize revealing fragments
  574. if( previousFragment() === false ) {
  575. if( availableRoutes().up ) {
  576. navigateUp();
  577. }
  578. else {
  579. // Fetch the previous horizontal slide, if there is one
  580. var previousSlide = document.querySelector( '#reveal .slides>section.past:nth-child(' + indexh + ')' );
  581. if( previousSlide ) {
  582. indexv = ( previousSlide.querySelectorAll('section').length + 1 ) || 0;
  583. indexh --;
  584. slide();
  585. }
  586. }
  587. }
  588. }
  589. /**
  590. * Same as #navigatePrev() but navigates forwards.
  591. */
  592. function navigateNext() {
  593. // Prioritize revealing fragments
  594. if( nextFragment() === false ) {
  595. availableRoutes().down ? navigateDown() : navigateRight();
  596. }
  597. }
  598. // Expose some methods publicly
  599. return {
  600. initialize: initialize,
  601. navigateTo: navigateTo,
  602. navigateLeft: navigateLeft,
  603. navigateRight: navigateRight,
  604. navigateUp: navigateUp,
  605. navigateDown: navigateDown
  606. };
  607. })();