Skip to content

Commit 16afaa7

Browse files
authored
Merge pull request #3118 from nextcloud/newFileMenu-css-guidelines
Fit newFileMenu to css guidelines
2 parents 8024f5a + 0fc0bcf commit 16afaa7

3 files changed

Lines changed: 12 additions & 41 deletions

File tree

apps/files/css/files.css

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -768,46 +768,20 @@ html.ie8 #controls .button.new {
768768
}
769769

770770
.newFileMenu {
771-
width: 200px;
772-
margin-left: -56px;
773-
margin-top: 25px;
771+
font-weight: 300;
772+
top: 100%;
773+
margin-top: 4px;
774+
min-width: 100px;
775+
margin-left: 7px;
774776
z-index: 1001;
775777
}
776778

777-
.newFileMenu .menuitem {
778-
white-space: nowrap;
779-
overflow: hidden;
780-
}
781-
.newFileMenu.popovermenu a.menuitem,
782-
.newFileMenu.popovermenu label.menuitem,
783-
.newFileMenu.popovermenu .menuitem {
784-
padding: 0;
785-
margin: 0;
786-
}
787-
788-
.newFileMenu.popovermenu a.menuitem.active {
789-
opacity: 1;
790-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
791-
filter: alpha(opacity=100);
792-
}
793-
794-
.newFileMenu.bubble:after {
795-
left: 75px;
796-
right: auto;
797-
}
798-
.newFileMenu.bubble:before {
799-
left: 75px;
800-
right: auto;
801-
}
802-
803779
.newFileMenu .filenameform {
804780
display: inline-block;
805781
}
806782

807783
.newFileMenu .filenameform input {
808-
width: 100%;
809-
box-sizing: border-box;
810-
margin: -2px 0;
784+
margin: 2px 0;
811785
}
812786

813787
#fileList .popovermenu .action {
@@ -835,6 +809,9 @@ html.ie8 #controls .button.new {
835809
height: 15px;
836810
}
837811

812+
.app-files .actions .button.new {
813+
position: relative;
814+
}
838815
.app-files .actions .button.new .icon {
839816
margin-bottom: 2px;
840817
}

apps/files/js/filelist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2951,7 +2951,7 @@
29512951
this._newFileMenu = new OCA.Files.NewFileMenu({
29522952
fileList: this
29532953
});
2954-
$('body').append(this._newFileMenu.$el);
2954+
$('.actions').append(this._newFileMenu.$el);
29552955
}
29562956
this._newFileMenu.showAt($target);
29572957

apps/files/js/newfilemenu.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
*/
3939
var NewFileMenu = OC.Backbone.View.extend({
4040
tagName: 'div',
41-
className: 'newFileMenu popovermenu bubble hidden open menu',
41+
// Menu is opened by default because it's rendered on "add-button" click
42+
className: 'newFileMenu popovermenu bubble menu open menu-left',
4243

4344
events: {
4445
'click .menuitem': '_onClickAction'
@@ -235,13 +236,6 @@
235236
*/
236237
showAt: function($target) {
237238
this.render();
238-
var targetOffset = $target.offset();
239-
this.$el.css({
240-
left: targetOffset.left,
241-
top: targetOffset.top + $target.height()
242-
});
243-
this.$el.removeClass('hidden');
244-
245239
OC.showMenu(null, this.$el);
246240
}
247241
});

0 commit comments

Comments
 (0)