2
0
forked from Wavyzz/dolibarr

Fix: possibility to split buttons and files view

This commit is contained in:
Regis Houssin
2011-07-13 07:38:10 +00:00
parent 2996c5f581
commit b66cea6955
2 changed files with 38 additions and 14 deletions

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formfile.class.php
* \ingroup core
* \brief File of class to offer components to list and upload files
* \version $Id: html.formfile.class.php,v 1.47 2011/07/10 21:17:14 eldy Exp $
* \version $Id: html.formfile.class.php,v 1.48 2011/07/13 07:38:11 hregis Exp $
*/
@@ -845,6 +845,10 @@ class FormFile
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
print '</div></form>';
print '</div><!-- end div fileupload -->';
print '<div id="fileupload-view">';
print '<div class="fileupload-content">';
print '<table width="100%" class="files">';
@@ -859,8 +863,8 @@ class FormFile
// We remove this because there is already individual bars.
//print '<div class="fileupload-progressbar"></div>';
print '</div>';
print '</div>';
print '</div><!-- end div fileupload-content -->';
print '</div><!-- end div fileupload-view -->';
// Include template
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php');

View File

@@ -65,7 +65,9 @@
data.isAdjusted = true;
data.isValidated = that._validate(data.files);
data.context = that._renderUpload(data.files)
.appendTo($(this).find('.files')).fadeIn(function () {
// DOL_CHANGE
//.appendTo($(this).find('.files')).fadeIn(function () {
.appendTo($('#fileupload-view').find('.files')).fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
}).data('data', data);
@@ -119,7 +121,9 @@
} else {
that._renderDownload(data.result)
.css('display', 'none')
.appendTo($(this).find('.files'))
// DOL_CHANGE
//.appendTo($(this).find('.files'))
.appendTo($('#fileupload-view').find('.files'))
.fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
@@ -153,7 +157,9 @@
that._adjustMaxNumberOfFiles(-data.files.length);
data.context = that._renderUpload(data.files)
.css('display', 'none')
.appendTo($(this).find('.files'))
// DOL_CHANGE
//.appendTo($(this).find('.files'))
.appendTo($('#fileupload-view').find('.files'))
.fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
@@ -487,7 +493,9 @@
_initEventHandlers: function () {
$.blueimp.fileupload.prototype._initEventHandlers.call(this);
var filesList = this.element.find('.files'),
// DOL_CHANGE
//var filesList = this.element.find('.files'),
var filesList = $('#fileupload-view').find('.files'),
eventData = {fileupload: this};
filesList.find('.start button')
.live(
@@ -510,7 +518,9 @@
},
_destroyEventHandlers: function () {
var filesList = this.element.find('.files');
// DOL_CHANGE
//var filesList = this.element.find('.files'),
var filesList = $('#fileupload-view').find('.files');
filesList.find('.start button')
.die('click.' + this.options.namespace);
filesList.find('.cancel button')
@@ -522,7 +532,9 @@
_initFileUploadButtonBar: function () {
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
filesList = this.element.find('.files'),
// DOL_CHANGE
//filesList = this.element.find('.files'),
filesList = $('#fileupload-view').find('.files'),
ns = this.options.namespace;
fileUploadButtonBar
.addClass('ui-widget-header ui-corner-top');
@@ -607,16 +619,24 @@
this.element
.addClass('ui-widget');
this._initFileUploadButtonBar();
this.element.find('.fileupload-content')
// DOL_CHANGE
//this.element.find('.fileupload-content')
$('#fileupload-view').find('.fileupload-content')
.addClass('ui-widget-content ui-corner-bottom');
this.element.find('.fileupload-progressbar')
// DOL_CHANGE
//this.element.find('.fileupload-progressbar')
$('#fileupload-view').find('.fileupload-progressbar')
.hide().progressbar();
},
destroy: function () {
this.element.find('.fileupload-progressbar')
// DOL_CHANGE
//this.element.find('.fileupload-progressbar')
$('#fileupload-view').find('.fileupload-progressbar')
.progressbar('destroy');
this.element.find('.fileupload-content')
// DOL_CHANGE
//this.element.find('.fileupload-content')
$('#fileupload-view').find('.fileupload-content')
.removeClass('ui-widget-content ui-corner-bottom');
this._destroyFileUploadButtonBar();
this.element.removeClass('ui-widget');