Merge pull request #3118 from nextcloud/newFileMenu-css-guidelines

Fit newFileMenu to css guidelines
This commit is contained in:
Morris Jobke 2017-01-22 20:39:16 -06:00 committed by GitHub
commit 16afaa783b
3 changed files with 12 additions and 41 deletions

View File

@ -768,46 +768,20 @@ html.ie8 #controls .button.new {
} }
.newFileMenu { .newFileMenu {
width: 200px; font-weight: 300;
margin-left: -56px; top: 100%;
margin-top: 25px; margin-top: 4px;
min-width: 100px;
margin-left: 7px;
z-index: 1001; z-index: 1001;
} }
.newFileMenu .menuitem {
white-space: nowrap;
overflow: hidden;
}
.newFileMenu.popovermenu a.menuitem,
.newFileMenu.popovermenu label.menuitem,
.newFileMenu.popovermenu .menuitem {
padding: 0;
margin: 0;
}
.newFileMenu.popovermenu a.menuitem.active {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
}
.newFileMenu.bubble:after {
left: 75px;
right: auto;
}
.newFileMenu.bubble:before {
left: 75px;
right: auto;
}
.newFileMenu .filenameform { .newFileMenu .filenameform {
display: inline-block; display: inline-block;
} }
.newFileMenu .filenameform input { .newFileMenu .filenameform input {
width: 100%; margin: 2px 0;
box-sizing: border-box;
margin: -2px 0;
} }
#fileList .popovermenu .action { #fileList .popovermenu .action {
@ -835,6 +809,9 @@ html.ie8 #controls .button.new {
height: 15px; height: 15px;
} }
.app-files .actions .button.new {
position: relative;
}
.app-files .actions .button.new .icon { .app-files .actions .button.new .icon {
margin-bottom: 2px; margin-bottom: 2px;
} }

View File

@ -2951,7 +2951,7 @@
this._newFileMenu = new OCA.Files.NewFileMenu({ this._newFileMenu = new OCA.Files.NewFileMenu({
fileList: this fileList: this
}); });
$('body').append(this._newFileMenu.$el); $('.actions').append(this._newFileMenu.$el);
} }
this._newFileMenu.showAt($target); this._newFileMenu.showAt($target);

View File

@ -38,7 +38,8 @@
*/ */
var NewFileMenu = OC.Backbone.View.extend({ var NewFileMenu = OC.Backbone.View.extend({
tagName: 'div', tagName: 'div',
className: 'newFileMenu popovermenu bubble hidden open menu', // Menu is opened by default because it's rendered on "add-button" click
className: 'newFileMenu popovermenu bubble menu open menu-left',
events: { events: {
'click .menuitem': '_onClickAction' 'click .menuitem': '_onClickAction'
@ -235,13 +236,6 @@
*/ */
showAt: function($target) { showAt: function($target) {
this.render(); this.render();
var targetOffset = $target.offset();
this.$el.css({
left: targetOffset.left,
top: targetOffset.top + $target.height()
});
this.$el.removeClass('hidden');
OC.showMenu(null, this.$el); OC.showMenu(null, this.$el);
} }
}); });