Rev3224, Small cosmetic changes on sidebar Sign and publish button
This commit is contained in:
parent
acfe4deacf
commit
9c4093dc7c
7 changed files with 36 additions and 20 deletions
|
@ -10,9 +10,12 @@ class Menu
|
|||
@hide()
|
||||
else
|
||||
button_pos = @button.offset()
|
||||
@elem.css({"top": button_pos.top+@button.outerHeight(), "left": button_pos.left})
|
||||
left = button_pos.left
|
||||
@elem.css({"top": button_pos.top+@button.outerHeight(), "left": left})
|
||||
@button.addClass("menu-active")
|
||||
@elem.addClass("visible")
|
||||
if @elem.position().left + @elem.width() + 20 > window.innerWidth
|
||||
@elem.css("left", window.innerWidth - @elem.width() - 20)
|
||||
if window.visible_menu then window.visible_menu.hide()
|
||||
window.visible_menu = @
|
||||
|
||||
|
|
|
@ -359,7 +359,8 @@ class Sidebar extends Class
|
|||
@tag.find("#button-sign-publish-menu").removeClass("visible")
|
||||
@tag.find(".contents + .flex").removeClass("sign-publish-flex")
|
||||
|
||||
menu = new Menu(@tag.find("#wrapper-sign-publish"))
|
||||
menu = new Menu(@tag.find("#menu-sign-publish"))
|
||||
menu.elem.css("margin-top", "-130px") # Open upwards
|
||||
menu.addItem "Sign", =>
|
||||
inner_path = @tag.find("#input-contents").val()
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
.globe.error { text-align: center; padding-top: 156px; box-sizing: border-box; opacity: 0.2; }
|
||||
|
||||
/* Sign publish */
|
||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; }
|
||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; margin-top: 10px }
|
||||
.contents a { color: white }
|
||||
.contents a:active { background-color: #6B6B6B }
|
||||
|
||||
|
@ -145,7 +145,11 @@
|
|||
}
|
||||
#menu-sign-publish {
|
||||
margin-left: 5px;
|
||||
color: #AAA;
|
||||
padding: 7px;
|
||||
margin: 0px;
|
||||
}
|
||||
#menu-sign-publish:hover { color: white }
|
||||
|
||||
/* Small screen */
|
||||
@media screen and (max-width: 600px) {
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
.globe.error { text-align: center; padding-top: 156px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; opacity: 0.2; }
|
||||
|
||||
/* Sign publish */
|
||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; }
|
||||
.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; margin-top: 10px }
|
||||
.contents a { color: white }
|
||||
.contents a:active { background-color: #6B6B6B }
|
||||
|
||||
|
@ -223,7 +223,11 @@
|
|||
}
|
||||
#menu-sign-publish {
|
||||
margin-left: 5px;
|
||||
color: #AAA;
|
||||
padding: 7px;
|
||||
margin: 0px;
|
||||
}
|
||||
#menu-sign-publish:hover { color: white }
|
||||
|
||||
/* Small screen */
|
||||
@media screen and (max-width: 600px) {
|
||||
|
|
|
@ -73,18 +73,22 @@
|
|||
}
|
||||
|
||||
Menu.prototype.show = function() {
|
||||
var button_pos;
|
||||
var button_pos, left;
|
||||
if (window.visible_menu && window.visible_menu.button[0] === this.button[0]) {
|
||||
window.visible_menu.hide();
|
||||
return this.hide();
|
||||
} else {
|
||||
button_pos = this.button.offset();
|
||||
left = button_pos.left;
|
||||
this.elem.css({
|
||||
"top": button_pos.top + this.button.outerHeight(),
|
||||
"left": button_pos.left
|
||||
"left": left
|
||||
});
|
||||
this.button.addClass("menu-active");
|
||||
this.elem.addClass("visible");
|
||||
if (this.elem.position().left + this.elem.width() + 20 > window.innerWidth) {
|
||||
this.elem.css("left", window.innerWidth - this.elem.width() - 20);
|
||||
}
|
||||
if (window.visible_menu) {
|
||||
window.visible_menu.hide();
|
||||
}
|
||||
|
@ -313,7 +317,8 @@ window.initScrollable = function () {
|
|||
@logStart("Preloading")
|
||||
wrapper.ws.cmd "sidebarGetHtmlTag", {}, (res) =>
|
||||
@logEnd("Preloading")
|
||||
@preload_html = res */
|
||||
@preload_html = res
|
||||
*/
|
||||
this.fixbutton.on("mousedown touchstart", (function(_this) {
|
||||
return function(e) {
|
||||
if (e.button > 0) {
|
||||
|
@ -692,7 +697,8 @@ window.initScrollable = function () {
|
|||
return _this.tag.find(".contents + .flex").removeClass("sign-publish-flex");
|
||||
};
|
||||
})(this));
|
||||
menu = new Menu(this.tag.find("#wrapper-sign-publish"));
|
||||
menu = new Menu(this.tag.find("#menu-sign-publish"));
|
||||
menu.elem.css("margin-top", "-130px");
|
||||
menu.addItem("Sign", (function(_this) {
|
||||
return function() {
|
||||
var inner_path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue