Controls on mobile, and dragging

- Not using #playbar anymore, since the default controls work on mobile
- Removed List.dragging code, not in use anymore
This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-21 17:48:25 +01:00
parent 9652abf10b
commit d4a2798dc8
4 changed files with 2 additions and 84 deletions

View File

@@ -158,7 +158,6 @@ var Admin = {
}); });
} }
} }
//List.dragging(true);
if($(".tabs").length > 0 && !changing_to_frontpage) { if($(".tabs").length > 0 && !changing_to_frontpage) {
$('ul.playlist-tabs-loggedIn').tabs('select_tab', $(".playlist-tabs li a.active").attr("href").substring(1)); $('ul.playlist-tabs-loggedIn').tabs('select_tab', $(".playlist-tabs li a.active").attr("href").substring(1));
} }
@@ -236,8 +235,6 @@ var Admin = {
$(".playlist-tabs").removeClass("hide"); $(".playlist-tabs").removeClass("hide");
} }
//List.dragging(false);
if($("ul.playlist-tabs-loggedIn .playlist-tab-links.active").attr("href") == "#suggestions" && $(".tabs").length > 0 && !changing_to_frontpage) if($("ul.playlist-tabs-loggedIn .playlist-tab-links.active").attr("href") == "#suggestions" && $(".tabs").length > 0 && !changing_to_frontpage)
{ {
$('ul.playlist-tabs').tabs('select_tab', 'wrapper'); $('ul.playlist-tabs').tabs('select_tab', 'wrapper');

View File

@@ -8,77 +8,6 @@ var List = {
not_found: [], not_found: [],
num_songs: 0, num_songs: 0,
dragging: function(enabled) {
if(!enabled) {
var jqDraggableItem = $(".list-song");
try {
$(".list-song").draggable("destroy");
} catch(e) {}
jqDraggableItem.off("touchstart", Helper.touchstart);
jqDraggableItem.off("touchmove", Helper.touchmove);
jqDraggableItem.off("touchend", Helper.touchend);
} else {
if(Helper.mobilecheck()) {
var jqDraggableItem = $(".list-song");
try {
$(".list-song").draggable("destroy");
} catch(e) {}
jqDraggableItem.off("touchstart", Helper.touchstart);
jqDraggableItem.off("touchmove", Helper.touchmove);
jqDraggableItem.off("touchend", Helper.touchend);
$( ".list-song" ).draggable({
axis:"x",
containment: [-60, 0, 10, 0],
scroll: true,
drag: function(event, ui) {
if(Helper.vertScroll) {
return false;
}
if(ui.offset.left <= -10) {
ui.position.left = ui.offset.left;
} else {
ui.position.left = 0;
}
},
stop: function(event, ui) {
if(ui.offset.left == -50 && !Helper.vertScroll) {
try {
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
if (navigator.vibrate) {
navigator.vibrate(100);
}
} catch(e) {}
$(".accept-delete").attr("data-video-id", $(this).attr("data-video-id"));
$("#delete_song_title").html($(this).find(".list-title").html());
$("#delete_song_alert").modal("open");
var that = this;
$(this).addClass("side_away");
$(this).css("left", "0px");
setTimeout(function() {
$(that).removeClass("side_away");
}, 300);
} else {
var that = this;
$(this).addClass("side_away");
$(this).css("left", "0px");
setTimeout(function() {
$(that).removeClass("side_away");
}, 300);
}
}
});
jqDraggableItem.on("touchstart", Helper.touchstart);
jqDraggableItem.on("touchmove", Helper.touchmove);
jqDraggableItem.on("touchend", Helper.touchend);
}
}
},
channel_function: function(msg) { channel_function: function(msg) {
if(user_auth_started) { if(user_auth_started) {
user_auth_started = false; user_auth_started = false;
@@ -100,7 +29,6 @@ var List = {
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id}); Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
} }
} }
//if(!w_p) List.dragging(true);
break; break;
case "added": case "added":
List.added_song(msg.value); List.added_song(msg.value);
@@ -109,7 +37,6 @@ var List = {
} }
found_array = []; found_array = [];
found_array_index = 0; found_array_index = 0;
//if(!w_p) List.dragging(true);
break; break;
case "deleted": case "deleted":
List.deleted_song(msg.value, msg.removed); List.deleted_song(msg.value, msg.removed);
@@ -125,7 +52,6 @@ var List = {
} }
found_array = []; found_array = [];
found_array_index = 0; found_array_index = 0;
//if(!w_p) List.dragging(true);
break; break;
case "song_change": case "song_change":
if(window.location.pathname != "/") List.song_change(msg.time, msg.remove); if(window.location.pathname != "/") List.song_change(msg.time, msg.remove);
@@ -134,7 +60,6 @@ var List = {
} }
found_array = []; found_array = [];
found_array_index = 0; found_array_index = 0;
//if(!w_p) List.dragging(true);
break; break;
case "changed_values": case "changed_values":
List.changedValues(msg.value); List.changedValues(msg.value);
@@ -146,7 +71,6 @@ var List = {
} }
found_array = []; found_array = [];
found_array_index = 0; found_array_index = 0;
//if(!w_p) List.dragging(true);
break; break;
} }
}, },

View File

@@ -3,9 +3,6 @@ var Playercontrols = {
stopInterval: false, stopInterval: false,
initYoutubeControls: function() { initYoutubeControls: function() {
if(Helper.mobilecheck() && !window.MSStream) {
$("#controls").appendTo("#playbar");
}
Playercontrols.initControls(); Playercontrols.initControls();
}, },

View File

@@ -8,7 +8,7 @@
{{> channel/players}} {{> channel/players}}
{{> channel/tabs}} {{> channel/tabs}}
</div> </div>
<div id="playbar"> <!--<div id="playbar">
</div> </div>-->
</main> </main>
</div> </div>