2 Deck JS - deck.menu - v1.0
3 Copyright (c) 2011 Caleb Troughton
4 Dual licensed under the MIT license and GPL license.
5 https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
10 This module adds the methods and key binding to show and hide a menu of all
11 slides in the deck. The deck menu state is indicated by the presence of a class
12 on the deck container.
14 (function($, deck, undefined) {
18 Extends defaults/options.
21 This class is added to the deck container when showing the slide menu.
24 The numeric keycode used to toggle between showing and hiding the slide
27 $.extend(true, $[deck].defaults, {
38 jQuery.deck('showMenu')
40 Shows the slide menu by adding the class specified by the menu class option
41 to the deck container.
43 $[deck]('extend', 'showMenu', function() {
44 $[deck]('getContainer').addClass($[deck]('getOptions').classes.menu);
48 jQuery.deck('hideMenu')
50 Hides the slide menu by removing the class specified by the menu class
51 option from the deck container.
53 $[deck]('extend', 'hideMenu', function() {
54 $[deck]('getContainer').removeClass($[deck]('getOptions').classes.menu);
58 jQuery.deck('toggleMenu')
60 Toggles between showing and hiding the slide menu.
62 $[deck]('extend', 'toggleMenu', function() {
63 $[deck]('getContainer').toggleClass($[deck]('getOptions').classes.menu);
66 $d.bind('deck.init', function() {
68 $d.bind('keydown.deck', function(e) {
69 if (e.which == $[deck]('getOptions').keys.menu) {
70 $[deck]('toggleMenu');