mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Support for some (optional) feedback during uploads.
SVN:trunk[3455]
This commit is contained in:
@@ -34,7 +34,7 @@ $(function()
|
|||||||
}
|
}
|
||||||
this.oImg = $('<img src="'+sIcon+'" style="vertical-align: middle;" foo="bar">');
|
this.oImg = $('<img src="'+sIcon+'" style="vertical-align: middle;" foo="bar">');
|
||||||
this.oLabel = $('<span>'+sLabel+'</span>');
|
this.oLabel = $('<span>'+sLabel+'</span>');
|
||||||
this.oButton = $('<button type="button"><div style="display: inline-block;vertical-align: middle;"><span class="ui-icon ui-icon-triangle-1-s"/></div></button>');
|
this.oButton = $('<button type="button" class="icon-select"><div style="display: inline-block;vertical-align: middle;"><span class="ui-icon ui-icon-triangle-1-s"/></div></button>');
|
||||||
this.oButton.prepend(this.oLabel).prepend(this.oImg);
|
this.oButton.prepend(this.oLabel).prepend(this.oImg);
|
||||||
this.oButton.click(function(event, ui) { me._on_button_clicked(event, ui); });
|
this.oButton.click(function(event, ui) { me._on_button_clicked(event, ui); });
|
||||||
this.element.after(this.oButton);
|
this.element.after(this.oButton);
|
||||||
@@ -49,7 +49,7 @@ $(function()
|
|||||||
});
|
});
|
||||||
if (this.options.post_upload_to != null)
|
if (this.options.post_upload_to != null)
|
||||||
{
|
{
|
||||||
this.oUploadBtn = $('<button type="button" title="'+this.options.labels['upload']+'"><div style="display: inline-block;position: relative;vertical-align:middle;height:48px; line-height:48px; width:16px"><span style="height:16px;display:block;position:absolute;top:50%;margin-top:-8px" class="ui-icon ui-icon-circle-plus"/></div></button>');
|
this.oUploadBtn = $('<button class="icon-select" type="button" title="'+this.options.labels['upload']+'"><div style="display: inline-block;position: relative;vertical-align:middle;height:48px; line-height:48px; width:16px"><span style="height:16px;display:block;position:absolute;top:50%;margin-top:-8px" class="ui-icon ui-icon-circle-plus"/></div></button>');
|
||||||
this.oUploadBtn.click( function() { me._upload_dlg(); } );
|
this.oUploadBtn.click( function() { me._upload_dlg(); } );
|
||||||
this.oButton.after(this.oUploadBtn);
|
this.oButton.after(this.oUploadBtn);
|
||||||
}
|
}
|
||||||
@@ -193,6 +193,12 @@ $(function()
|
|||||||
_do_upload: function()
|
_do_upload: function()
|
||||||
{
|
{
|
||||||
var me = this;
|
var me = this;
|
||||||
|
var $element = this.oUploadDlg.find('#file');
|
||||||
|
this.oUploadDlg.closest('.ui-dialog').find('.ui-button').button('disable');
|
||||||
|
if (ReplaceWithAnimation)
|
||||||
|
{
|
||||||
|
ReplaceWithAnimation($element);
|
||||||
|
}
|
||||||
$.ajaxFileUpload
|
$.ajaxFileUpload
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
@@ -226,11 +232,12 @@ $(function()
|
|||||||
this.oLabel.text(this.options.items[idx].label);
|
this.oLabel.text(this.options.items[idx].label);
|
||||||
}
|
}
|
||||||
this.element.trigger('change');
|
this.element.trigger('change');
|
||||||
this.oUploadDlg.dialog( "close" );
|
this.oUploadDlg.dialog('close');
|
||||||
},
|
},
|
||||||
_on_upload_error: function(data, status, e)
|
_on_upload_error: function(data, status, e)
|
||||||
{
|
{
|
||||||
alert(e);
|
alert(e);
|
||||||
|
this.oUploadDlg.closest('.ui-dialog').find('.ui-button').button('enable');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user