Fix tabs handling in the old layout. These shims are temporary.
This commit is contained in:
parent
560cdeb931
commit
75e32ad700
6 changed files with 27 additions and 6 deletions
|
@ -235,6 +235,21 @@ angular.module("core-ui", [])
|
|||
return directiveDefinitionObject;
|
||||
})
|
||||
|
||||
// TODO(jschorr): Remove this once new layout is in prod.
|
||||
.directive('corTabShim', function() {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 3,
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {},
|
||||
controller: function($rootScope, $scope, $element, $timeout, $location, UIService) {
|
||||
UIService.initializeTabs($scope, $element);
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
})
|
||||
|
||||
.directive('corTabs', function() {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 3,
|
||||
|
|
|
@ -171,7 +171,10 @@ angular.module('quay').factory('UIService', ['$timeout', '$rootScope', '$locatio
|
|||
return;
|
||||
}
|
||||
|
||||
uiService.clickElement(this);
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
uiService.clickElement(elem);
|
||||
}, 0);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -181,7 +184,10 @@ angular.module('quay').factory('UIService', ['$timeout', '$rootScope', '$locatio
|
|||
$timeout(function() {
|
||||
element.find('a[data-toggle="tab"]').each(function(index) {
|
||||
if (index == 0) {
|
||||
uiService.clickElement(this);
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
uiService.clickElement(elem);
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="row">
|
||||
<!-- Side tabs -->
|
||||
<div class="col-md-2">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<ul class="nav nav-pills nav-stacked cor-tab-shim">
|
||||
<li class="active" quay-require="['BILLING']">
|
||||
<a href="javascript:void(0)" data-toggle="tab" data-target="#plan">Plan and Usage</a>
|
||||
</li>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<div class="row">
|
||||
<!-- Side tabs -->
|
||||
<div class="col-md-2">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<ul class="nav nav-pills nav-stacked cor-tab-shim">
|
||||
<li class="active"><a href="javascript:void(0)" data-toggle="tab" data-target="#permissions">Permissions</a></li>
|
||||
<li><a href="javascript:void(0)" data-toggle="tab" data-target="#trigger" ng-click="loadTriggers()"
|
||||
quay-show="Features.BUILD_SUPPORT">Build Triggers</a></li>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<div class="row" ng-show="builds.length">
|
||||
<!-- Side tabs -->
|
||||
<div class="col-sm-2">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<ul class="nav nav-pills nav-stacked cor-tab-shim">
|
||||
<li ng-class="currentBuild == build ? 'active' : ''" ng-repeat="build in builds">
|
||||
<a class="build-tab-link" href="javascript:void(0)" ng-click="setCurrentBuild(build.id, true)">
|
||||
<span class="phase-icon" ng-class="build.phase"></span>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="row">
|
||||
<!-- Side tabs -->
|
||||
<div class="col-md-2">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<ul class="nav nav-pills nav-stacked cor-tab-shim">
|
||||
<!-- Billing Related -->
|
||||
<li class="active" quay-require="['BILLING']"><a href="javascript:void(0)" data-toggle="tab" data-target="#plan">Plan and Usage</a></li>
|
||||
<li ng-show="hasPaidPlan" quay-require="['BILLING']">
|
||||
|
|
Reference in a new issue