diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2010-06-21 21:30:28 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2010-06-21 21:30:28 +0400 |
commit | bdd5badf93fba7fa789533e708fdbabb396acf9c (patch) | |
tree | f5b3e37cc69fe898f87fbb37d39b3a4ca5984d35 /plugins/Goals/templates/GoalForm.js | |
parent | c114df1598cf0968b0c469b78d004e0e7b5b6761 (diff) |
Refs #774 Adding a 'cancel' link below the add/edit Goals forms (to restore screen state previous to click)
git-svn-id: http://dev.piwik.org/svn/trunk@2326 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Goals/templates/GoalForm.js')
-rw-r--r-- | plugins/Goals/templates/GoalForm.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js index 2f79f09729..13ed40ba5e 100644 --- a/plugins/Goals/templates/GoalForm.js +++ b/plugins/Goals/templates/GoalForm.js @@ -1,20 +1,37 @@ function showAddNewGoal() { + hideForms(); $("#GoalForm").show(); - $("#EditGoals").hide(); + showCancel(); piwikHelper.lazyScrollTo("#AddEditGoals", 400); return false; } function showEditGoals() { + hideForms(); $("#EditGoals").show(); - $("#GoalForm").hide(); + showCancel(); piwikHelper.lazyScrollTo("#AddEditGoals", 400); return false; } +function hideForms() +{ + $("#GoalForm").hide(); + $("#EditGoals").hide(); +} + +function showCancel() +{ + $("#goalsCancel").show(); + $('#goalsCancelLink').click( function(){ + hideForms(); + $("#goalsCancel").hide(); + }); +} + // init the goal form with existing goal value, if any function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, caseSensitive, revenue, goalId) { |