diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 5d4d74b6..7a2f4360 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -317,7 +317,7 @@ function seek_au_sec(seek) { if (mp.au === mp.au_native) // hack: ogv.js breaks on .play() during playback mp.au.play(); -}; +} function song_skip(n) { @@ -329,7 +329,7 @@ function song_skip(n) { play(mp.order.indexOf(tid) + n); else play(mp.order[0]); -}; +} // hook up the widget buttons @@ -618,13 +618,16 @@ function tree_neigh(n) { break; } } - a += n; - if (a < 0) - a = links.length - 1; - if (a >= links.length) - a = 0; + if (act == -1) + return; - links[a].click(); + act += n; + if (act < 0) + act = links.length - 1; + if (act >= links.length) + act = 0; + + links[act].click(); } @@ -939,8 +942,7 @@ var treectl = (function () { tree.style.top = Math.max(0, parseInt(atop)) + 'px'; } else { - var wraph = parseInt(getComputedStyle(ebi('wrap').offsetParent).height), - top = Math.max(0, parseInt(wrap.offsetTop)), + var top = Math.max(0, parseInt(wrap.offsetTop)), treeh = (winh - atop) - 4; tree.style.top = top + 'px'; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 600822bf..f2c3ebf4 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -374,7 +374,7 @@ function up2k_init(have_crypto) { for (var a = 0, aa = Math.min(20, bad_files.length); a < aa; a++) msg += '-- ' + bad_files[a] + '\n'; - if (files.length - bad_files.length <= 1 && /(android)/i.test(navigator.userAgent)) + if (good_files.length - bad_files.length <= 1 && /(android)/i.test(navigator.userAgent)) msg += '\nFirefox-Android has a bug which prevents selecting multiple files. Try selecting one file at a time. For more info, see firefox bug 1456557'; alert(msg); diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 01538622..1aef3fa4 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -119,7 +119,7 @@ function crc32(str) { crc = (crc >>> 8) ^ crctab[(crc ^ str.charCodeAt(i)) & 0xFF]; } return ((crc ^ (-1)) >>> 0).toString(16); -}; +} function clmod(obj, cls, add) {