|
73 | 73 | } |
74 | 74 |
|
75 | 75 | Menu.prototype.show = function() { |
76 | | - var button_pos; |
| 76 | + var button_pos, left; |
77 | 77 | if (window.visible_menu && window.visible_menu.button[0] === this.button[0]) { |
78 | 78 | window.visible_menu.hide(); |
79 | 79 | return this.hide(); |
80 | 80 | } else { |
81 | 81 | button_pos = this.button.offset(); |
| 82 | + left = button_pos.left; |
82 | 83 | this.elem.css({ |
83 | 84 | "top": button_pos.top + this.button.outerHeight(), |
84 | | - "left": button_pos.left |
| 85 | + "left": left |
85 | 86 | }); |
86 | 87 | this.button.addClass("menu-active"); |
87 | 88 | this.elem.addClass("visible"); |
| 89 | + if (this.elem.position().left + this.elem.width() + 20 > window.innerWidth) { |
| 90 | + this.elem.css("left", window.innerWidth - this.elem.width() - 20); |
| 91 | + } |
88 | 92 | if (window.visible_menu) { |
89 | 93 | window.visible_menu.hide(); |
90 | 94 | } |
@@ -313,7 +317,8 @@ window.initScrollable = function () { |
313 | 317 | @logStart("Preloading") |
314 | 318 | wrapper.ws.cmd "sidebarGetHtmlTag", {}, (res) => |
315 | 319 | @logEnd("Preloading") |
316 | | - @preload_html = res */ |
| 320 | + @preload_html = res |
| 321 | + */ |
317 | 322 | this.fixbutton.on("mousedown touchstart", (function(_this) { |
318 | 323 | return function(e) { |
319 | 324 | if (e.button > 0) { |
@@ -692,7 +697,8 @@ window.initScrollable = function () { |
692 | 697 | return _this.tag.find(".contents + .flex").removeClass("sign-publish-flex"); |
693 | 698 | }; |
694 | 699 | })(this)); |
695 | | - menu = new Menu(this.tag.find("#wrapper-sign-publish")); |
| 700 | + menu = new Menu(this.tag.find("#menu-sign-publish")); |
| 701 | + menu.elem.css("margin-top", "-130px"); |
696 | 702 | menu.addItem("Sign", (function(_this) { |
697 | 703 | return function() { |
698 | 704 | var inner_path; |
|
0 commit comments