Commit 1add78e2 authored by Henning Leutz's avatar Henning Leutz 🥋

fix: upload form resize and height calculation fixed

parent afa01def
......@@ -33,7 +33,6 @@
.controls-upload-buttons {
clear: both;
float: left;
height: 30px;
position: relative;
width: 100%;
z-index: 2;
......
......@@ -70,7 +70,8 @@ define('controls/upload/Form', [
'$onFileUploadFinish',
'$onFileUploadRefresh',
'$onFileUploadCancel',
'$onError'
'$onError',
'$onInject'
],
/**
......@@ -119,6 +120,7 @@ define('controls/upload/Form', [
this.$Info = null;
this.addEvents({
onInject : this.$onInject,
onDestroy: function () {
if (self.$Form) {
self.$Form.destroy();
......@@ -257,7 +259,7 @@ define('controls/upload/Form', [
}
});
this.$Loader = new QUILoader().inject(this.$Elm);
this.Loader = new QUILoader().inject(this.$Elm);
this.$Buttons = this.$Elm.getElement('.controls-upload-buttons');
this.$BgText = this.$Elm.getElement('.controls-upload-bg-text');
......@@ -392,6 +394,24 @@ define('controls/upload/Form', [
return this.$Elm;
},
/**
* event: on inject
*/
$onInject: function () {
this.resize();
},
/**
* resize the form
*/
resize: function () {
var buttonsHeight = this.$Buttons.getSize().y;
var inforHeight = this.$Info.getSize().y;
var height = buttonsHeight + inforHeight;
this.$Form.setStyle('height', 'calc(100% - ' + height + 'px)');
},
/**
* Create the icon view
*/
......@@ -916,7 +936,7 @@ define('controls/upload/Form', [
return;
}
this.$Loader.show();
this.Loader.show();
this.fireEvent('submit', [this.getFiles(), this]);
// send to upload manager
......@@ -996,7 +1016,7 @@ define('controls/upload/Form', [
}
}
this.$Loader.hide();
this.Loader.hide();
this.fireEvent('finished', [this]);
this.$finished = true;
}.bind(this));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment