Highligh currently selected category button instead of showing the title
This commit is contained in:
@@ -276,11 +276,11 @@
|
||||
|
||||
<div ng-show="ready && validSubscription" class="ng-cloak appstore-toolbar">
|
||||
<div class="appstore-toolbar-content">
|
||||
<button class="btn" type="button" ng-click="showCategory('');">All</button>
|
||||
<button class="btn" type="button" ng-click="showCategory('featured');">Popular</button>
|
||||
<button class="btn" type="button" ng-click="showCategory('new');">New Apps</button>
|
||||
<button class="btn" type="button" ng-click="showCategory('');" ng-class="{ 'btn-primary': '' === category }">All</button>
|
||||
<button class="btn" type="button" ng-click="showCategory('featured');" ng-class="{ 'btn-primary': 'featured' === category }">Popular</button>
|
||||
<button class="btn" type="button" ng-click="showCategory('new');" ng-class="{ 'btn-primary': 'new' === category }">New Apps</button>
|
||||
<div class="dropdown">
|
||||
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown" ng-class="{ 'btn-primary': '' !== category && 'recent' !== category && 'featured' !== category && 'new' !== category }">
|
||||
{{ categoryButtonLabel(category) }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
@@ -300,7 +300,6 @@
|
||||
<a href="https://forum.cloudron.io/category/5/app-requests" target="_blank">Missing an app? Let us know.</a>
|
||||
</div>
|
||||
<div class="col-md-12" ng-show="apps.length">
|
||||
<h3>{{ categoryLabel(category) }}</h3>
|
||||
<div class="row-no-margin">
|
||||
<div class="col-sm-1 appstore-item" ng-repeat="app in apps | orderBy:'installCount':true">
|
||||
<div class="appstore-item-content highlight" ng-click="gotoApp(app)" ng-class="{ 'appstore-item-content-testing': app.releaseState === 'unstable' }">
|
||||
|
||||
@@ -70,17 +70,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
return 'Category';
|
||||
};
|
||||
|
||||
$scope.categoryLabel = function (category) {
|
||||
if (category === 'new') return 'New Apps';
|
||||
if (category === 'recent') return 'Recently Updated';
|
||||
if (category === 'featured') return 'Popular Apps';
|
||||
|
||||
var tmp = $scope.categories.find(function (c) { return c.id === category; });
|
||||
if (tmp) return tmp.label;
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
$scope.appInstall = {
|
||||
busy: false,
|
||||
state: 'appInfo',
|
||||
|
||||
Reference in New Issue
Block a user