Avoid JS errors after [29057]. This is not how _.debounce() works.

See #24716.


git-svn-id: https://develop.svn.wordpress.org/trunk@29071 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-07-10 18:02:53 +00:00
parent 5b6340a221
commit e8ce4559ed

View File

@ -588,13 +588,17 @@
}
// The right arrow key
if ( event.keyCode === 39 ) {
if ( ! this.hasNext ) { return; }
_.debounce( this.nextMediaItem(), 250 );
if ( ! this.hasNext ) {
return;
}
this.nextMediaItem();
}
// The left arrow key
if ( event.keyCode === 37 ) {
if ( ! this.hasPrevious ) { return; }
_.debounce( this.previousMediaItem(), 250 );
if ( ! this.hasPrevious ) {
return;
}
this.previousMediaItem();
}
},