Merged in bugfix/HOR-4039 (pull request #6189)
HOR-4039 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
69bc46364a
@@ -243,13 +243,31 @@ Ext.onReady(function() {
|
|||||||
emptyText: '',
|
emptyText: '',
|
||||||
fieldLabel: _('ID_IMAGE'),
|
fieldLabel: _('ID_IMAGE'),
|
||||||
buttonText: _('ID_SELECT_FILE'),
|
buttonText: _('ID_SELECT_FILE'),
|
||||||
name : 'img'
|
name: 'img',
|
||||||
|
validator: function (filePath) {
|
||||||
|
var flag, btn;
|
||||||
|
btn = Ext.getCmp('btnUpload');
|
||||||
|
btn.disable();
|
||||||
|
|
||||||
|
filePath = filePath.replace(/^\s|\s$/g, ""); //trims string
|
||||||
|
if (filePath.match(/([^\/\\]+)\.(gif|png|jpg|jpeg|pjpeg|x-png)$/i)) {
|
||||||
|
flag = true;
|
||||||
|
btn.enable();
|
||||||
|
} else {
|
||||||
|
messageError = _('ID_ERROR_UPLOADING_IMAGE_TYPE');
|
||||||
|
PMExt.notify(_('ID_ERROR'), messageError);
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons:
|
buttons:
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: _('ID_UPLOAD'),
|
text: _('ID_UPLOAD'),
|
||||||
|
id: 'btnUpload',
|
||||||
|
disabled: true,
|
||||||
handler: function () {
|
handler: function () {
|
||||||
panelRightTop.getForm().submit({
|
panelRightTop.getForm().submit({
|
||||||
url: '../adminProxy/uploadImage',
|
url: '../adminProxy/uploadImage',
|
||||||
|
|||||||
Reference in New Issue
Block a user