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
1 changed files with 9 additions and 1 deletions

View File

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