Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filepicker styling #2342

Merged
merged 5 commits into from
Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions core/css/jquery.ocdialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@
color: #333;
border-radius: 3px; box-shadow: 0 0 7px #888;
padding: 15px;
z-index: 1000;
z-index: 10000;
font-size: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
min-width: 200px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-height: calc(100% - 20px);
max-width: calc(100% - 20px);
overflow: auto;
}
.oc-dialog-title {
background: #fff;
margin-left: 12px;
}
.oc-dialog-content {
z-index: 1000;
}
.oc-dialog-separator {
}
.oc-dialog-buttonrow {
position: relative;
display: block;
background: transparent;
right: 0;
bottom: 0;
padding: 10px;
padding-bottom: 0;
box-sizing: border-box;
width: 100%;
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
Expand All @@ -42,6 +45,14 @@
.oc-dialog-buttonrow.onebutton button {
float: right;
}
.oc-dialog-buttonrow:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}

.oc-dialog-close {
position: absolute;
Expand All @@ -59,3 +70,7 @@
top: 0; left: 0;
width: 100%; height: 100%;
}

.oc-dialog-content {
width: 100%;
}
2 changes: 1 addition & 1 deletion core/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
box-sizing: border-box;
display: inline-block;
overflow-y: auto;
height: 321px;
height: 100%; /** overflow under the button row */
width: 100%;
padding-bottom: 55px;
}
Expand Down
34 changes: 6 additions & 28 deletions core/js/jquery.ocdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,8 @@
return false;
}
});
$(window).resize(function() {
self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body');
var pos = self.parent.position();
self.$dialog.css({
left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2,
top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2,
width: Math.min(self.options.width, $(window).innerWidth() - 20 ),
height: Math.min(self.options.height, $(window).innerHeight() - 20)
});
// set sizes of content
self._setSizes();
});

this._setOptions(this.options);
$(window).trigger('resize');
this._createOverlay();
},
_init: function() {
Expand Down Expand Up @@ -172,25 +159,16 @@
$.Widget.prototype._setOptions.apply(this, arguments);
},
_setSizes: function() {
var content_height = this.$dialog.height();
var lessHeight = 0;
if(this.$title) {
content_height -= this.$title.outerHeight(true);
lessHeight += this.$title.outerHeight(true);
}
if(this.$buttonrow) {
content_height -= this.$buttonrow.outerHeight(true);
}
this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body');
content_height = Math.min(content_height, this.parent.height()-20);
if (content_height> 0) {
this.element.css({
height: content_height + 'px',
width: this.$dialog.innerWidth() - 30 + 'px'
});
} else {
this.element.css({
width : this.$dialog.innerWidth() - 30 + 'px'
});
lessHeight += this.$buttonrow.outerHeight(true);
}
this.element.css({
'height': 'calc(100% - ' + lessHeight + 'px)'
});
},
_createOverlay: function() {
if(!this.options.modal) {
Expand Down
11 changes: 2 additions & 9 deletions core/js/oc-dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ var OCdialogs = {
self.$filePicker.ocdialog({
closeOnEscape: true,
// max-width of 600
width: Math.min((4/5)*$(document).width(), 600),
height: 420,
width: 600,
height: 500,
modal: modal,
buttons: buttonlist,
close: function() {
Expand All @@ -253,10 +253,6 @@ var OCdialogs = {
} else {
buttonEnableDisable.prop("disabled", true);
}

if (!OC.Util.hasSVGSupport()) {
OC.Util.replaceSVG(self.$filePicker.parent());
}
})
.fail(function(status, error) {
// If the method is called while navigating away
Expand Down Expand Up @@ -835,9 +831,6 @@ var OCdialogs = {
});

self.$filelist.removeClass('icon-loading');
if (!OC.Util.hasSVGSupport()) {
OC.Util.replaceSVG(self.$filePicker.find('.dirtree'));
}
});
},
/**
Expand Down