update PHP Excel
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
function getInfo(action, fOnSuccess, vars, fOnError, bProcessIcon)
|
||||
function getInfo(action, fOnSuccess, vars, fOnError, $ProcessButton)
|
||||
{
|
||||
if(!vars) vars = {};
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
//if(bProcessIcon) self.addBufferIcon();
|
||||
if($ProcessButton) $ProcessButton.startProcess();
|
||||
|
||||
vars['a'] = action;
|
||||
$.ajax(
|
||||
@@ -13,16 +12,13 @@ function getInfo(action, fOnSuccess, vars, fOnError, bProcessIcon)
|
||||
})
|
||||
.done(function(oData)
|
||||
{
|
||||
if($ProcessButton) $ProcessButton.stopProcess();
|
||||
if(oData.result==oPedidor.consts.error) fOnError(oData.desc);
|
||||
else
|
||||
{
|
||||
//if(bProcessIcon) self.resetIcon();
|
||||
fOnSuccess(oData);
|
||||
}
|
||||
else fOnSuccess(oData.data);
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
//if(bProcessIcon) self.resetIcon();
|
||||
if($ProcessButton) $ProcessButton.stopProcess();
|
||||
if(!fOnError) console.log(textStatus+' '+errorThrown);
|
||||
else fOnError(textStatus);
|
||||
});
|
||||
@@ -52,11 +48,12 @@ function copyArray(asArray)
|
||||
return asArray.slice(0); //trick to copy array
|
||||
}
|
||||
|
||||
$.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, bPrepend)
|
||||
$.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, bPrepend, bProcessIcon)
|
||||
{
|
||||
bPrepend = bPrepend || false;
|
||||
$This = $(this);
|
||||
sButtonClass = sButtonClass || '';
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
var asAttributes = {id:(sId || ''),
|
||||
'class':'button'+(typeof sButtonClass != 'undefined'?' '+sButtonClass:''),
|
||||
title:sTitle};
|
||||
@@ -78,11 +75,25 @@ $.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, b
|
||||
else $Button.appendTo($This);
|
||||
|
||||
//Function
|
||||
if(!bLink) $Button.click(function(e){e.preventDefault(); oClickLink($(this));});
|
||||
if(!bLink) $Button.click(function(e){
|
||||
e.preventDefault();
|
||||
var $This = $(this);
|
||||
if(bProcessIcon) $This.startProcess();
|
||||
oClickLink($This);
|
||||
});
|
||||
|
||||
return $This;
|
||||
};
|
||||
|
||||
$.prototype.startProcess = function()
|
||||
{
|
||||
$(this).find('.fa').addClass('spinner fa-spin');
|
||||
}
|
||||
|
||||
$.prototype.stopProcess = function()
|
||||
{
|
||||
$(this).find('.fa').removeClass('spinner fa-spin');
|
||||
}
|
||||
|
||||
$.prototype.addDefaultValue = function(sDefaultValue, sInitValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user