Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgiehl <stefangiehl@gmail.com>2012-11-20 02:00:41 +0400
committersgiehl <stefangiehl@gmail.com>2012-11-20 02:00:41 +0400
commit99793151cd6d4f318b7a011509bd421685f0537a (patch)
tree623b9521c3551d32d5eb808f57511ed38fe8e19a /plugins/Goals/templates/GoalForm.js
parentdf1c54f0f7e50dfd670ab294d908e44ed4dbac44 (diff)
refs #3359 moving ajax requests to a new ajax helper with more functionality as the old functions
git-svn-id: http://dev.piwik.org/svn/trunk@7489 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Goals/templates/GoalForm.js')
-rw-r--r--plugins/Goals/templates/GoalForm.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js
index df0124507d..78f4477566 100644
--- a/plugins/Goals/templates/GoalForm.js
+++ b/plugins/Goals/templates/GoalForm.js
@@ -103,27 +103,27 @@ function bindGoalForm()
function ajaxDeleteGoal(idGoal)
{
piwikHelper.lazyScrollTo(".entityContainer", 400);
- piwikHelper.showAjaxLoading('goalAjaxLoading');
var parameters = {};
parameters.format = 'json';
parameters.idGoal = idGoal;
+ parameters.module = 'API';
+ parameters.method = 'Goals.deleteGoal';
- piwikHelper.ajaxCallApi(
- 'Goals.deleteGoal',
- parameters,
+ var ajaxRequest = new ajaxHelper();
+ ajaxRequest.addParams(parameters, 'get');
+ ajaxRequest.setLoadingElement('#goalAjaxLoading');
+ ajaxRequest.setCallback(
function (response) {
piwikHelper.ajaxHandleResponse(response, 'goalAjaxLoading', parameters);
- },
- 'json',
- false
+ }
);
+ ajaxRequest.send(true);
}
function ajaxAddGoal()
{
piwikHelper.lazyScrollTo(".entityContainer", 400);
- piwikHelper.showAjaxLoading('goalAjaxLoading');
var parameters = {};
parameters.name = encodeURIComponent( $('#goal_name').val() );
@@ -144,16 +144,18 @@ function ajaxAddGoal()
parameters.idGoal = $('input[name=goalIdUpdate]').val();
parameters.format = 'json';
+ parameters.module = 'API';
+ parameters.method = $('input[name=methodGoalAPI]').val();
- piwikHelper.ajaxCallApi(
- $('input[name=methodGoalAPI]').val(),
- parameters,
+ var ajaxRequest = new ajaxHelper();
+ ajaxRequest.addParams(parameters, 'get');
+ ajaxRequest.setLoadingElement('#goalAjaxLoading');
+ ajaxRequest.setCallback(
function (response) {
piwikHelper.ajaxHandleResponse(response, 'goalAjaxLoading', parameters);
- },
- 'json',
- false
+ }
);
+ ajaxRequest.send(true);
}
function bindListGoalEdit()