MCPcopy Index your code
hub / github.com/imakewebthings/deck.js / bindKeyEvents

Function bindKeyEvents

core/deck.core.js:176–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 };
175
176 var bindKeyEvents = function() {
177 var editables = [
178 'input',
179 'textarea',
180 'select',
181 'button',
182 'meter',
183 'progress',
184 '[contentEditable]'
185 ].join(', ');
186
187 $document.unbind('keydown.deck').bind('keydown.deck', function(event) {
188 var isNext = event.which === options.keys.next;
189 var isPrev = event.which === options.keys.previous;
190 isNext = isNext || $.inArray(event.which, options.keys.next) > -1;
191 isPrev = isPrev || $.inArray(event.which, options.keys.previous) > -1;
192
193 if (isNext) {
194 methods.next();
195 event.preventDefault();
196 }
197 else if (isPrev) {
198 methods.prev();
199 event.preventDefault();
200 }
201 });
202
203 $document.undelegate(editables, 'keydown.deck', stopPropagation);
204 $document.delegate(editables, 'keydown.deck', stopPropagation);
205 };
206
207 var bindTouchEvents = function() {
208 var startTouch;

Callers 1

deck.core.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected