Skip to content

Commit

Permalink
fix: json update
Browse files Browse the repository at this point in the history
Signed-off-by: jianfei.zhang <[email protected]>
  • Loading branch information
falser101 committed Jul 28, 2022
1 parent e0027d8 commit 6897403
Showing 1 changed file with 16 additions and 1 deletion.
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)
}
scope.namespace.editText = text
}

}
};

Expand Down

0 comments on commit 6897403

Please sign in to comment.