Permalink
Browse files

Add next and prev methods and shortcuts

  • Loading branch information...
1 parent 2e0d585 commit 569adf1b335eace2496e5fc930f57172f4d29a4d @jaysalvat jaysalvat committed Dec 14, 2012
Showing with 28 additions and 4 deletions.
  1. +27 −2 public/javascripts/hvidio.js
  2. +0 −1 public/stylesheets/style.css
  3. +1 −1 public/stylesheets/style.less
@@ -303,12 +303,37 @@
return this;
},
+ jump: function(index) {
+ var embed = $('.video').eq(index).find('.play').attr('href');
+
+ hvidio.play(embed);
+ },
+
next: function() {
- console.log('next');
+ var index = $('.current').index('.video');
+
+ index++;
+
+ if (index > $('.video').size() - 1) {
+ index = 0;
+ $results.mCustomScrollbar("scrollTo", 0);
+ }
+
+ hvidio.jump(index);
},
prev: function() {
- console.log('prev');
+ var index = $('.current').index('.video');
+
+ index--;
+
+ if (index < 0) {
+ index = $('.video').size() - 1;
+
+ $results.mCustomScrollbar("scrollTo", 20000);
+ }
+
+ hvidio.jump(index);
},
resize: function() {
@@ -144,7 +144,6 @@ p.tagline {
position: relative;
}
#results .video {
- visibility: hidden;
float: left;
margin: 10px 10px;
min-height: 200px;
@@ -169,7 +169,7 @@ p.tagline {
}
.video {
- visibility: hidden;
+
float: left;
margin: 10px 10px;
min-height: @cell-height;

0 comments on commit 569adf1

Please sign in to comment.