This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

ENHANCEMENT add namespaces to jQuery event handlers

  • Loading branch information...
michalochman committed Jun 20, 2012
1 parent 0bb0722 commit 462d1e2f657f0496903600785a57a4d7098870d1
Showing with 6 additions and 6 deletions.
  1. +6 −6 features/bootstrap/SilverStripe/Test/Behaviour/BasicContext.php
@@ -71,17 +71,17 @@ public function afterStep($event)
public function ajaxClickHandler_before() {
$javascript = <<<JS
window.jQuery(document).on('ajaxStart', function(){
window.jQuery(document).on('ajaxStart.ss.test.behaviour', function(){
window.__ajaxStatus = function() {
return 'waiting';
};
});
window.jQuery(document).on('ajaxComplete', function(){
window.jQuery(document).on('ajaxComplete.ss.test.behaviour', function(){
window.__ajaxStatus = function() {
return 'no ajax';
};
});
window.jQuery(document).on('ajaxSuccess', function(){
window.jQuery(document).on('ajaxSuccess.ss.test.behaviour', function(){
window.__ajaxStatus = function() {
return 'success';
};
@@ -95,9 +95,9 @@ public function ajaxClickHandler_after() {
"(typeof window.__ajaxStatus !== 'undefined' ? window.__ajaxStatus() : 'no ajax') !== 'waiting'"
);
$javascript = <<<JS
window.jQuery(document).off('ajaxStart');
window.jQuery(document).off('ajaxComplete');
window.jQuery(document).off('ajaxSuccess');
window.jQuery(document).off('ajaxStart.ss.test.behaviour');
window.jQuery(document).off('ajaxComplete.ss.test.behaviour');
window.jQuery(document).off('ajaxSuccess.ss.test.behaviour');
JS;
$this->getSession()->executeScript($javascript);
}

0 comments on commit 462d1e2

Please sign in to comment.