', { id: 'cp-fileupload' }).append(tableHeader).append($table).appendTo($body);
$('.cp-fileupload-header-close').click(function () {
File.$container.fadeOut();
});
+ File.$container.mouseenter(function () {
+ hover = true;
+ }).mouseleave(function () {
+ hover = false;
+ });
return File.$container;
};
@@ -209,6 +215,11 @@ define([
window.setTimeout(function () { File.$container.show(); });
var file = queue.queue.shift();
if (file.dl) { return void file.dl(file); }
+ if (file.$line && file.$line[0] && !hover) {
+ var line = file.$line[0];
+ line.scrollIntoView(false);
+ }
+ delete file.$line;
upload(file);
};
queue.push = function (obj) {
@@ -224,7 +235,7 @@ define([
$('
', {'class':'cp-fileupload-table-progressbar'}).appendTo($progressContainer);
$('', {'class':'cp-fileupload-table-progress-value'}).text(Messages.upload_pending).appendTo($progressContainer);
- var $tr = $('', {id: id}).appendTo($table);
+ var $tr = obj.$line = $('
', {id: id}).appendTo($table);
var $lines = $table.find('tr[id]');
if ($lines.length > 5) {
//$lines.slice(0, $lines.length - 5).remove();
@@ -257,6 +268,15 @@ define([
// cancel
$('', {'class': 'cp-fileupload-table-cancel'}).append($cancel).appendTo($tr);
+ var tw = $table.width();
+ var cw = File.$container.prop('clientWidth');
+ var diff = tw - cw;
+ if (diff && diff > 0) {
+ $table.css('margin-right', diff+'px');
+ } else {
+ $table.css('margin-right', '');
+ }
+
queue.next();
};
|