diff options
author | diosmosis <benaka@piwik.pro> | 2015-03-16 06:59:45 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-03-16 06:59:45 +0300 |
commit | 6e6c42985b01615766995baa301ca78da9bb61f3 (patch) | |
tree | 36c9b2d0725a3b785f237df4aa9968e964116bc8 /plugins | |
parent | 5cb1f5f257ad243551ac6eb11445702e65ab32ab (diff) |
Fix bug in admin goal form, 'change' event handlers removed because iCheck initialization happened after bindGoalForm global function executed. bindGoalForm was executed after in API page since it does not use $(document).ready(). Now it does.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Goals/templates/_addEditGoal.twig | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/Goals/templates/_addEditGoal.twig b/plugins/Goals/templates/_addEditGoal.twig index 94db74df41..dc217c9a66 100644 --- a/plugins/Goals/templates/_addEditGoal.twig +++ b/plugins/Goals/templates/_addEditGoal.twig @@ -40,20 +40,21 @@ <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'click'") }} \ <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'(.*)_banner'") }}" }; - bindGoalForm(); - - {% if onlyShowAddNewGoal is not defined %} - piwik.goals = {{ goalsJSON|raw }}; - bindListGoalEdit(); - - {% if idGoal %} - editGoal({{ idGoal|e('js') }}); + $(document).ready(function () { + bindGoalForm(); + + {% if onlyShowAddNewGoal is not defined %} + piwik.goals = {{ goalsJSON|raw }}; + bindListGoalEdit(); + + {% if idGoal %} + editGoal({{ idGoal|e('js') }}); + {% else %} + showEditGoals(); + {% endif %} {% else %} - showEditGoals(); + initAndShowAddGoalForm(); {% endif %} - {% else %} - initAndShowAddGoalForm(); - {% endif %} - + }); </script> |