提交 583b098e 编写于 作者: Z zhangle

bugfix: add view items

上级 e2f07784
......@@ -65,7 +65,7 @@ directive_module.directive('apollonspanel',
function initNamespace(namespace, viewType) {
namespace.showSearchInput = false;
namespace.sourceItems = namespace.items;
namespace.viewItems = namespace.items;
namespace.isPropertiesFormat = namespace.format == 'properties';
namespace.isTextEditing = false;
namespace.instanceViewType = namespace_instance_view_type.LATEST_RELEASE;
......@@ -345,7 +345,7 @@ directive_module.directive('apollonspanel',
function parseModel2Text(namespace) {
if (namespace.sourceItems.length == 0) {
if (namespace.items.length == 0) {
namespace.itemCnt = MIN_ROW_SIZE;
return "";
}
......@@ -360,7 +360,7 @@ directive_module.directive('apollonspanel',
}
function parseNotPropertiesText(namespace) {
var text = namespace.sourceItems[0].item.value;
var text = namespace.items[0].item.value;
var lineNum = text.split("\n").length;
namespace.itemCnt = lineNum < MIN_ROW_SIZE ? MIN_ROW_SIZE : lineNum;
return text;
......@@ -369,7 +369,7 @@ directive_module.directive('apollonspanel',
function parsePropertiesText(namespace) {
var result = "";
var itemCnt = 0;
namespace.sourceItems.forEach(function (item) {
namespace.items.forEach(function (item) {
//deleted key
if (!item.item.dataChangeLastModifiedBy) {
return;
......@@ -398,13 +398,13 @@ directive_module.directive('apollonspanel',
function searchItems(namespace) {
var searchKey = namespace.searchKey.toLowerCase();
var items = [];
namespace.sourceItems.forEach(function (item) {
namespace.items.forEach(function (item) {
var key = item.item.key;
if (key && key.toLowerCase().indexOf(searchKey) >= 0){
items.push(item);
}
});
namespace.items = items;
namespace.viewItems = items;
}
function lockCheck(namespace) {
......
......@@ -176,7 +176,7 @@
</thead>
<tbody>
<tr ng-repeat="config in namespace.items" ng-class="{warning:config.isModified}"
<tr ng-repeat="config in namespace.viewItems" ng-class="{warning:config.isModified}"
ng-if="config.item.key && !config.isDeleted">
<td width="20%" title="{{config.item.key}}">
<span ng-bind="config.item.key | limitTo: 250"></span>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册