Skip to content

Commit c4e43f9

Browse files
committed
[push] Trigger type change disables next button in create auto message
1 parent def192f commit c4e43f9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

plugins/push/frontend/public/javascripts/component.push.popup.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,18 @@ window.component('push.popup', function(popup) {
786786
{ value: true, title: t('pu.po.tab1.trigger-type.entry'), desc: t('pu.po.tab1.cohort-entry-desc') },
787787
{ value: false, title: t('pu.po.tab1.trigger-type.exit'), desc: t('pu.po.tab1.cohort-exit-desc') },
788788
{ value: 'events', title: t('pu.po.tab1.trigger-type.event'), desc: t('pu.po.tab1.cohort-event-desc') },
789-
], value: message.autoOnEntry, onchange: function(){
790-
message.autoEvents([]);
791-
message.autoCohorts([]);
792-
}
789+
], value: message.autoOnEntry, onchange: function(neo, old){
790+
neo = typeof neo === 'boolean';
791+
old = typeof old === 'boolean';
792+
if (neo ^ old) {
793+
message.autoEvents([]);
794+
message.autoCohorts([]);
795+
cohorts.forEach(function(c){ c.selected(false); });
796+
events.forEach(function(c){ c.selected(false); });
797+
this.selectCohorts.value([]);
798+
this.selectEvents.value([]);
799+
}
800+
}.bind(this)
793801
});
794802
this.selectEvents = new C.multiselect.controller({
795803
placeholder: t('pu.po.tab1.select-event-placeholder'),

plugins/push/frontend/public/javascripts/component.radio.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ window.component('radio', function(radio) {
1717
this.value = function(){
1818
if (arguments.length) {
1919
if (opts.onchange) {
20-
opts.onchange(arguments[0]);
20+
opts.onchange(arguments[0], val());
2121
}
2222
val(arguments[0]);
2323
}

0 commit comments

Comments
 (0)