Merge pull request #1538 from vinyldarkscratch/master
Add web2py componentBegin event
This commit is contained in:
@@ -317,6 +317,7 @@
|
|||||||
'beforeSend': function (xhr, settings) {
|
'beforeSend': function (xhr, settings) {
|
||||||
xhr.setRequestHeader('web2py-component-location', document.location);
|
xhr.setRequestHeader('web2py-component-location', document.location);
|
||||||
xhr.setRequestHeader('web2py-component-element', target);
|
xhr.setRequestHeader('web2py-component-element', target);
|
||||||
|
web2py.fire(element, 'w2p:componentBegin', [xhr, settings], target);
|
||||||
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
||||||
},
|
},
|
||||||
'success': function (data, status, xhr) {
|
'success': function (data, status, xhr) {
|
||||||
|
|||||||
@@ -317,6 +317,7 @@
|
|||||||
'beforeSend': function (xhr, settings) {
|
'beforeSend': function (xhr, settings) {
|
||||||
xhr.setRequestHeader('web2py-component-location', document.location);
|
xhr.setRequestHeader('web2py-component-location', document.location);
|
||||||
xhr.setRequestHeader('web2py-component-element', target);
|
xhr.setRequestHeader('web2py-component-element', target);
|
||||||
|
web2py.fire(element, 'w2p:componentBegin', [xhr, settings], target);
|
||||||
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
||||||
},
|
},
|
||||||
'success': function (data, status, xhr) {
|
'success': function (data, status, xhr) {
|
||||||
|
|||||||
@@ -317,6 +317,7 @@
|
|||||||
'beforeSend': function (xhr, settings) {
|
'beforeSend': function (xhr, settings) {
|
||||||
xhr.setRequestHeader('web2py-component-location', document.location);
|
xhr.setRequestHeader('web2py-component-location', document.location);
|
||||||
xhr.setRequestHeader('web2py-component-element', target);
|
xhr.setRequestHeader('web2py-component-element', target);
|
||||||
|
web2py.fire(element, 'w2p:componentBegin', [xhr, settings], target);
|
||||||
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
|
||||||
},
|
},
|
||||||
'success': function (data, status, xhr) {
|
'success': function (data, status, xhr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user