Swipe/click chat to toggle sidebar. Close #9

This commit is contained in:
Mattias Erming 2014-06-13 16:23:37 +02:00
parent 95596f4039
commit fca95d9b79

View File

@ -255,9 +255,17 @@ $(function() {
if (touchDevice) { if (touchDevice) {
toggle = "touchstart"; toggle = "touchstart";
} }
chat.on(toggle, ".lt, .rt", function() {
chat.on(toggle, ".lt, .rt", function(e) {
var btn = $(this); var btn = $(this);
viewport.toggleClass(btn.attr("class")); viewport.toggleClass(btn.attr("class"));
if (viewport.hasClass("lt")) {
e.stopPropagation();
viewport.find("#main").one(toggle, function(e) {
viewport.removeClass("lt");
});
}
}); });
function toArray(val) { function toArray(val) {