Added correct context for ajaxComplete event triggering

Re-implementation of PR #157 as that was created with a much older version of the codebase.