Commit f3708887 by Jason Song Committed by GitHub

Merge pull request #397 from lepdou/search_item

bugfix: add view items
parents 588029d6 583b098e
......@@ -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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment