Skip to content

Commit

Permalink
Emulate short click for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jul 29, 2017
1 parent 527c2b4 commit a69531c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions plugins/Sidebar/media/Sidebar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Sidebar extends Class
@fixbutton_addx = @fixbutton.offset().left-mousex
@startDrag()
@fixbutton.parent().on "click touchend touchcancel", (e) =>
if (+ new Date)-@dragStarted < 100
window.top.location = @fixbutton.find(".fixbutton-bg").attr("href")
@stopDrag()
@resized()
$(window).on "resize", @resized
Expand Down
12 changes: 10 additions & 2 deletions plugins/Sidebar/media/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
}).call(this);



/* ---- plugins/Sidebar/media/RateLimit.coffee ---- */


Expand Down Expand Up @@ -87,7 +86,6 @@
}).call(this);



/* ---- plugins/Sidebar/media/Scrollable.js ---- */


Expand Down Expand Up @@ -260,6 +258,9 @@ window.initScrollable = function () {
})(this));
this.fixbutton.parent().on("click touchend touchcancel", (function(_this) {
return function(e) {
if ((+(new Date)) - _this.dragStarted < 100) {
window.top.location = _this.fixbutton.find(".fixbutton-bg").attr("href");
}
return _this.stopDrag();
};
})(this));
Expand Down Expand Up @@ -647,6 +648,13 @@ window.initScrollable = function () {
});
};
})(this));
this.tag.find(".close").off("click touchend").on("click touchend", (function(_this) {
return function(e) {
_this.startDrag();
_this.stopDrag();
return false;
};
})(this));
return this.loadGlobe();
};

Expand Down

0 comments on commit a69531c

Please sign in to comment.