mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 12:50:35 +03:00
luci: Fix update text after edit for NFQWS2_OPT
This commit is contained in:
@@ -460,7 +460,7 @@ return baseclass.extend({
|
|||||||
'class': 'cbi-input-textarea',
|
'class': 'cbi-input-textarea',
|
||||||
'style': 'width:100% !important',
|
'style': 'width:100% !important',
|
||||||
'rows': this.rows,
|
'rows': this.rows,
|
||||||
'wrap': 'on',
|
'wrap': 'off',
|
||||||
'spellcheck': 'false',
|
'spellcheck': 'false',
|
||||||
},
|
},
|
||||||
content)
|
content)
|
||||||
@@ -506,29 +506,27 @@ return baseclass.extend({
|
|||||||
value = value.replace(/˂/g, '<');
|
value = value.replace(/˂/g, '<');
|
||||||
value = value.replace(/˃/g, '>');
|
value = value.replace(/˃/g, '>');
|
||||||
try {
|
try {
|
||||||
let elem2 = null;
|
let elem = document.getElementById("cbi-" + this.appName + "-" + this.cfgsec + "-_" + this.cfgparam);
|
||||||
let elem = document.getElementById("cbi-zapret-" + this.cfgsec + "-_" + this.cfgparam);
|
|
||||||
if (elem) {
|
if (elem) {
|
||||||
if (!elem2) {
|
if (elem.querySelector('div')) {
|
||||||
elem2 = elem.querySelector('div');
|
elem = elem.querySelector('div');
|
||||||
}
|
} else {
|
||||||
if (!elem2) {
|
elem = elem.querySelector('output');
|
||||||
elem2 = elem.querySelector('output');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (elem2) {
|
if (elem) {
|
||||||
let val = value.trim();
|
let val = value.trim();
|
||||||
if (this.multiline) {
|
if (this.multiline) {
|
||||||
val = val.replace(/</g, '˂');
|
val = val.replace(/</g, '˂');
|
||||||
val = val.replace(/>/g, '˃');
|
val = val.replace(/>/g, '˃');
|
||||||
val = val.replace(/\n/g, '<br/>');
|
val = val.replace(/\n/g, '<br/>');
|
||||||
elem2.innerHTML = val;
|
elem.innerHTML = val;
|
||||||
} else {
|
} else {
|
||||||
elem2.textContent = val;
|
elem.textContent = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error('ERROR: cannot found elem for ' + this.cfgparam);
|
console.error('ERROR: cannot found elem for ' + this.cfgsec + '.' + this.cfgparam);
|
||||||
}
|
}
|
||||||
uci.set(this.appName, this.cfgsec, this.cfgparam, value);
|
uci.set(this.appName, this.cfgsec, this.cfgparam, value);
|
||||||
uci.save().then(ui.hideModal);
|
uci.save().then(ui.hideModal);
|
||||||
|
|||||||
Reference in New Issue
Block a user