Pass previous operator to afterUpdateRuleOperator event#547
Pass previous operator to afterUpdateRuleOperator event#547mistic100 merged 1 commit intomistic100:devfrom
Conversation
|
Could also do it for afterUpdateRuleFilter, afterUpdateRuleValue and afterUpdateGroupCondition ? (these needs to update the method calls on core.js lines 285 and 300) |
|
I'm on it, but ... updateRuleValue is called also in updateRuleOperator function (just after afterUpdateRuleOperator event) - what should be passed there? QueryBuilder.prototype.updateRuleValue = function(rule, oldValue) {
...
}but updateRuleOperator doesn't change the rule value ... so ... undefined? EDIT: Well - it changes value in one case: if (!rule.operator || rule.operator.nb_inputs === 0) { ... }so I will copy value of |
|
@mistic100 Is it enough to merge? |
|
There is a pending review. |
|
@giero there is still a pending review |
src/core.js
Outdated
| */ | ||
| QueryBuilder.prototype.updateRuleOperator = function(rule, previousOperator) { | ||
| var $valueContainer = rule.$el.find(QueryBuilder.selectors.value_container); | ||
| var ruleValue = rule.__.value; |
There was a problem hiding this comment.
you can just use rule.value, __ is only useful to set the value without triggering an update event
|
@giero Sorry the review was not published, I didn't see it because the behavior changed some months ago |
|
@mistic100 |
Added previousOperator to 'afterUpdateRuleOperator' event - could be useful in some cases ;)