Skip to content

Commit

Permalink
Fix #181
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Aug 30, 2013
1 parent 5b3f6a8 commit 186f9ae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
22 changes: 7 additions & 15 deletions hawtio-web/src/main/webapp/app/karaf/html/features.html
Expand Up @@ -28,24 +28,16 @@
</div>

<div class="pull-right">
<form class="form-inline no-bottom-margin">
<fieldset>
<div class="pull-right control-group inline-block">
<input type="text" class="search-query" placeholder="Filter..." ng-model="filter">
</div>
</fieldset>
</form>
</div>
</div>


<!--
<div class="row-fluid">
<div hawtio-editor="repositoriesString" mode="javascript"></div>
</div>
<div class="row-fluid">
<div hawtio-editor="featuresString" mode="javascript"></div>
</div>
<div class="row-fluid">
<div hawtio-editor="resultString" mode="javascript"></div>
</div>
-->

<div class="row-fluid">
<div class="gridStyle" ng-grid="featureOptions"></div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions hawtio-web/src/main/webapp/app/karaf/js/features.ts
Expand Up @@ -66,6 +66,12 @@ module Karaf {
}
});

self.scope.$watch('filter', (newValue, oldValue) => {
if (newValue !== oldValue) {
self.evalFilter();
}
});

self.init = function (childScope, grid) {
self.grid = grid;
self.childScope = childScope;
Expand All @@ -86,6 +92,11 @@ module Karaf {
return item.entity.Installed;
});
}
if (self.scope.filter) {
byRepo = byRepo.findAll((item) => {
return item.entity.Name.has(self.scope.filter) || item.entity.Version.has(self.scope.filter) || item.entity.RepositoryName.has(self.scope.filter);
});
}
self.grid.filteredRows = byRepo;
self.grid.rowFactory.filteredRowsChanged();
};
Expand Down

0 comments on commit 186f9ae

Please sign in to comment.