From 2dd1db166aa18202f0001d1134315f547170edb9 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Wed, 6 May 2015 12:14:56 -0700 Subject: [PATCH] Fix annoyance: Clicking Remove video scrolls to top --- templates/channel.jade | 2 +- www/js/util.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/channel.jade b/templates/channel.jade index c0f1aa9d..b1b953b8 100644 --- a/templates/channel.jade +++ b/templates/channel.jade @@ -20,7 +20,7 @@ html(lang="en") b.caret ul.dropdown-menu li: a(href="#" onclick="javascript:chatOnly()") Chat Only - li: a(href="#" onclick="javascript:removeVideo()") Remove Video + li: a(href="#" onclick="javascript:removeVideo(event)") Remove Video mixin navloginlogout(cname) section#mainpage .container diff --git a/www/js/util.js b/www/js/util.js index 0e97838c..dfd1e0b8 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -1730,7 +1730,7 @@ function handleVideoResize() { $(window).resize(handleWindowResize); handleWindowResize(); -function removeVideo() { +function removeVideo(event) { try { PLAYER.setVolume(0); if (PLAYER.type === "rv") { @@ -1741,6 +1741,7 @@ function removeVideo() { $("#videowrap").remove(); $("#chatwrap").removeClass("col-lg-5 col-md-5").addClass("col-md-12"); + if (event) event.preventDefault(); } /* channel administration stuff */