/*! Deck JS - deck.goto Copyright (c) 2011-2014 Caleb Troughton Dual licensed under the MIT license. https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt */ /* This module adds the necessary methods and key bindings to show and hide a form for jumping to any slide number/id in the deck (and processes that form accordingly). The form-showing state is indicated by the presence of a class on the deck container. */ (function($, undefined) { var $document = $(document); var rootCounter; var bindKeyEvents = function() { $document.unbind('keydown.deckgoto'); $document.bind('keydown.deckgoto', function(event) { var key = $.deck('getOptions').keys.goto; if (event.which === key || $.inArray(event.which, key) > -1) { event.preventDefault(); $.deck('toggleGoTo'); } }); }; var populateDatalist = function() { var options = $.deck('getOptions'); var $datalist = $(options.selectors.gotoDatalist); $.each($.deck('getSlides'), function(i, $slide) { var id = $slide.attr('id'); if (id) { $datalist.append('