Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed overwrite JSON type configuration being empty #4486

Merged
merged 14 commits into from
Jul 30, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
}

function modifyByText(namespace) {

var model = {
configText: namespace.editText,
namespaceId: namespace.baseInfo.id,
Expand Down Expand Up @@ -816,7 +817,6 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
}

function parseModel2Text(namespace) {

if (namespace.items.length == 0) {
namespace.itemCnt = 0;
return "";
Expand Down Expand Up @@ -987,6 +987,21 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
minLines: 10,
maxLines: 20
})
},
onChange: function (e) {
if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText")) && (scope.namespace.editText.length === 0)) {
let text = ''
for (let i = 0; i < e[0].lines.length; i++) {
if (i === 0) {
text = e[0].lines[0]
} else {
text += '\r\n' + e[0].lines[i]
}
console.log(text)
falser101 marked this conversation as resolved.
Show resolved Hide resolved
}
scope.namespace.editText = text
}

}
};

Expand Down