forked from Wavyzz/dolibarr
Fix: possibility to split buttons and files view
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
* \file htdocs/core/class/html.formfile.class.php
|
* \file htdocs/core/class/html.formfile.class.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File of class to offer components to list and upload files
|
* \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,8 +845,12 @@ class FormFile
|
|||||||
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
|
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
|
||||||
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
|
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
|
||||||
print '</div></form>';
|
print '</div></form>';
|
||||||
|
|
||||||
|
print '</div><!-- end div fileupload -->';
|
||||||
|
|
||||||
|
print '<div id="fileupload-view">';
|
||||||
print '<div class="fileupload-content">';
|
print '<div class="fileupload-content">';
|
||||||
|
|
||||||
print '<table width="100%" class="files">';
|
print '<table width="100%" class="files">';
|
||||||
/*print '<tr>';
|
/*print '<tr>';
|
||||||
print '<td>'.$langs->trans("Documents2").'</td>';
|
print '<td>'.$langs->trans("Documents2").'</td>';
|
||||||
@@ -859,8 +863,8 @@ class FormFile
|
|||||||
// We remove this because there is already individual bars.
|
// We remove this because there is already individual bars.
|
||||||
//print '<div class="fileupload-progressbar"></div>';
|
//print '<div class="fileupload-progressbar"></div>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div><!-- end div fileupload-content -->';
|
||||||
print '</div>';
|
print '</div><!-- end div fileupload-view -->';
|
||||||
|
|
||||||
// Include template
|
// Include template
|
||||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php');
|
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php');
|
||||||
|
|||||||
@@ -65,7 +65,9 @@
|
|||||||
data.isAdjusted = true;
|
data.isAdjusted = true;
|
||||||
data.isValidated = that._validate(data.files);
|
data.isValidated = that._validate(data.files);
|
||||||
data.context = that._renderUpload(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:
|
// Fix for IE7 and lower:
|
||||||
$(this).show();
|
$(this).show();
|
||||||
}).data('data', data);
|
}).data('data', data);
|
||||||
@@ -119,7 +121,9 @@
|
|||||||
} else {
|
} else {
|
||||||
that._renderDownload(data.result)
|
that._renderDownload(data.result)
|
||||||
.css('display', 'none')
|
.css('display', 'none')
|
||||||
.appendTo($(this).find('.files'))
|
// DOL_CHANGE
|
||||||
|
//.appendTo($(this).find('.files'))
|
||||||
|
.appendTo($('#fileupload-view').find('.files'))
|
||||||
.fadeIn(function () {
|
.fadeIn(function () {
|
||||||
// Fix for IE7 and lower:
|
// Fix for IE7 and lower:
|
||||||
$(this).show();
|
$(this).show();
|
||||||
@@ -153,7 +157,9 @@
|
|||||||
that._adjustMaxNumberOfFiles(-data.files.length);
|
that._adjustMaxNumberOfFiles(-data.files.length);
|
||||||
data.context = that._renderUpload(data.files)
|
data.context = that._renderUpload(data.files)
|
||||||
.css('display', 'none')
|
.css('display', 'none')
|
||||||
.appendTo($(this).find('.files'))
|
// DOL_CHANGE
|
||||||
|
//.appendTo($(this).find('.files'))
|
||||||
|
.appendTo($('#fileupload-view').find('.files'))
|
||||||
.fadeIn(function () {
|
.fadeIn(function () {
|
||||||
// Fix for IE7 and lower:
|
// Fix for IE7 and lower:
|
||||||
$(this).show();
|
$(this).show();
|
||||||
@@ -487,7 +493,9 @@
|
|||||||
|
|
||||||
_initEventHandlers: function () {
|
_initEventHandlers: function () {
|
||||||
$.blueimp.fileupload.prototype._initEventHandlers.call(this);
|
$.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};
|
eventData = {fileupload: this};
|
||||||
filesList.find('.start button')
|
filesList.find('.start button')
|
||||||
.live(
|
.live(
|
||||||
@@ -510,7 +518,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_destroyEventHandlers: function () {
|
_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')
|
filesList.find('.start button')
|
||||||
.die('click.' + this.options.namespace);
|
.die('click.' + this.options.namespace);
|
||||||
filesList.find('.cancel button')
|
filesList.find('.cancel button')
|
||||||
@@ -522,7 +532,9 @@
|
|||||||
|
|
||||||
_initFileUploadButtonBar: function () {
|
_initFileUploadButtonBar: function () {
|
||||||
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
|
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;
|
ns = this.options.namespace;
|
||||||
fileUploadButtonBar
|
fileUploadButtonBar
|
||||||
.addClass('ui-widget-header ui-corner-top');
|
.addClass('ui-widget-header ui-corner-top');
|
||||||
@@ -607,16 +619,24 @@
|
|||||||
this.element
|
this.element
|
||||||
.addClass('ui-widget');
|
.addClass('ui-widget');
|
||||||
this._initFileUploadButtonBar();
|
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');
|
.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();
|
.hide().progressbar();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
this.element.find('.fileupload-progressbar')
|
// DOL_CHANGE
|
||||||
|
//this.element.find('.fileupload-progressbar')
|
||||||
|
$('#fileupload-view').find('.fileupload-progressbar')
|
||||||
.progressbar('destroy');
|
.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');
|
.removeClass('ui-widget-content ui-corner-bottom');
|
||||||
this._destroyFileUploadButtonBar();
|
this._destroyFileUploadButtonBar();
|
||||||
this.element.removeClass('ui-widget');
|
this.element.removeClass('ui-widget');
|
||||||
|
|||||||
Reference in New Issue
Block a user