Skip to content

Commit

Permalink
fix: fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
muink committed Oct 21, 2024
1 parent eebb49d commit 05564d0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class RulesEntry {
this.input = entry || '';
this.rawparams = this.input.split(',');
this.type = this.rawparams.shift() || '';
this.logical = hm.rules_logical_type.map(e => e[0] || e).includes(this.type);
var logical_payload, rawfactor;
(function(rawparams_typecuted) {
logical_payload = rawparams_typecuted.match(/^\(.*\)/);
Expand Down Expand Up @@ -135,8 +134,9 @@ class RulesEntry {
}

toString() {
var factor = '';
if (this.logical) {
var logical = hm.rules_logical_type.map(e => e[0] || e).includes(this.type),
factor = '';
if (logical) {
let n = hm.rules_logical_payload_count[this.type] || 0;
factor = '(%s)'.format(this.payload.slice(0, n).map((payload) => {
return '(%s‚%s)'.format(payload.type || '', payload.factor || '');
Expand Down Expand Up @@ -565,7 +565,7 @@ return view.extend({
so.onchange = function(ev, section_id, value) {
var UIEl = this.section.getUIElement(section_id, 'entry');

var newvalue = new RulesEntry(('N' + UIEl.getValue()).replace(/^[^,]+/, value)).toString();
var newvalue = new RulesEntry(UIEl.getValue()).setKey('type', value).toString();

UIEl.node.previousSibling.innerText = newvalue;
return UIEl.setValue(newvalue);
Expand Down

0 comments on commit 05564d0

Please sign in to comment.