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:
authorMatthieu Aubry <matt@piwik.org>2015-07-06 13:11:32 +0300
committerMatthieu Aubry <matt@piwik.org>2015-07-06 13:11:32 +0300
commitb6da1c00b7d4eae46e8b320b5838ccd4f0a150b2 (patch)
treef16a77b89548b3f4b8a8d05c730e337211f6a154
parentbfeb49b6cd0c927f703fd610aeead9b0b65a4a1b (diff)
parentc66d279559e3fead27f3cd168bb6a2b46f5651ea (diff)
Merge pull request #8267 from barbushin/8244_goals_form_fix
Fix triggers select in Add Goal form
-rw-r--r--plugins/Goals/javascripts/goalsForm.js5
-rw-r--r--plugins/Goals/templates/_formAddGoal.twig36
2 files changed, 23 insertions, 18 deletions
diff --git a/plugins/Goals/javascripts/goalsForm.js b/plugins/Goals/javascripts/goalsForm.js
index 86cf500c38..c396ef0de2 100644
--- a/plugins/Goals/javascripts/goalsForm.js
+++ b/plugins/Goals/javascripts/goalsForm.js
@@ -70,6 +70,7 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte
$('select[name=trigger_type] option[value=manually]').prop('selected', true);
$('input[name=match_attribute]').prop('disabled', true);
$('#match_attribute_section').hide();
+ $('#match_attribute_section2').hide();
$('#manual_trigger_section').show();
matchAttribute = 'url';
} else {
@@ -104,15 +105,17 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte
function bindGoalForm() {
- $('select[name=trigger_type]').click(function () {
+ $('select[name=trigger_type]').change(function () {
var triggerTypeId = $(this).val();
if (triggerTypeId == "manually") {
$('input[name=match_attribute]').prop('disabled', true);
$('#match_attribute_section').hide();
+ $('#match_attribute_section2').hide();
$('#manual_trigger_section').show();
} else {
$('input[name=match_attribute]').removeProp('disabled');
$('#match_attribute_section').show();
+ $('#match_attribute_section2').show();
$('#manual_trigger_section').hide();
}
});
diff --git a/plugins/Goals/templates/_formAddGoal.twig b/plugins/Goals/templates/_formAddGoal.twig
index 5e0366fdb8..d8cdaf2ba4 100644
--- a/plugins/Goals/templates/_formAddGoal.twig
+++ b/plugins/Goals/templates/_formAddGoal.twig
@@ -12,27 +12,29 @@
<td><input type="text" name="name" value="" size="28" id="goal_name" class="inp"/></td>
</tr>
<tr>
- <td style='width:260px;' class="first">{{ 'Goals_GoalIsTriggered'|translate }}
+ <td style='width:260px;' class="first">{{ 'Goals_GoalIsTriggered'|translate }}</td>
+ <td>
<select name="trigger_type" class="inp">
<option value="visitors">{{ 'Goals_WhenVisitors'|translate }}</option>
<option value="manually">{{ 'Goals_Manually'|translate }}</option>
</select>
- </td>
- <td>
- <input type="radio" id="match_attribute_url" value="url" name="match_attribute"/>
- <label for="match_attribute_url">{{ 'Goals_VisitUrl'|translate }}</label>
- <br/>
- <input type="radio" id="match_attribute_title" value="title" name="match_attribute"/>
- <label for="match_attribute_title">{{ 'Goals_VisitPageTitle'|translate }}</label>
- <br/>
- <input type="radio" id="match_attribute_event" value="event" name="match_attribute"/>
- <label for="match_attribute_event">{{ 'Goals_SendEvent'|translate }}</label>
- <br/>
- <input type="radio" id="match_attribute_file" value="file" name="match_attribute"/>
- <label for="match_attribute_file">{{ 'Goals_Download'|translate }}</label>
- <br/>
- <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute"/>
- <label for="match_attribute_external_website">{{ 'Goals_ClickOutlink'|translate }}</label>
+
+ <p id="match_attribute_section2">
+ <input type="radio" id="match_attribute_url" value="url" name="match_attribute"/>
+ <label for="match_attribute_url">{{ 'Goals_VisitUrl'|translate }}</label>
+ <br/>
+ <input type="radio" id="match_attribute_title" value="title" name="match_attribute"/>
+ <label for="match_attribute_title">{{ 'Goals_VisitPageTitle'|translate }}</label>
+ <br/>
+ <input type="radio" id="match_attribute_event" value="event" name="match_attribute"/>
+ <label for="match_attribute_event">{{ 'Goals_SendEvent'|translate }}</label>
+ <br/>
+ <input type="radio" id="match_attribute_file" value="file" name="match_attribute"/>
+ <label for="match_attribute_file">{{ 'Goals_Download'|translate }}</label>
+ <br/>
+ <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute"/>
+ <label for="match_attribute_external_website">{{ 'Goals_ClickOutlink'|translate }}</label>
+ </p>
</td>
</tr>
</tbody>