未验证 提交 e600f5b8 编写于 作者: J Jason Song 提交者: GitHub

Merge pull request #1733 from nobodyiam/refresh-namespace-when-lazy-load

refresh namespace when doing lazy load
......@@ -128,9 +128,10 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
$scope.namespaces.forEach(function (namespace, index) {
if (namespace.baseInfo.namespaceName == result.baseInfo.namespaceName) {
result.showNamespaceBody = true;
result.initialized = true;
result.show = namespace.show;
$scope.namespaces[index] = result;
$scope.namespaces[index].showNamespaceBody = true;
$scope.namespaces[index].initialized = true;
}
});
......
......@@ -44,7 +44,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
var operate_branch_storage_key = 'OperateBranch';
scope.init = init;
scope.refreshNamespace = refreshNamespace;
scope.switchView = switchView;
scope.toggleItemSearchInput = toggleItemSearchInput;
scope.searchItems = searchItems;
......@@ -80,7 +80,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
preInit(scope.namespace);
if (!scope.lazyLoad || scope.namespace.initialized) {
init(false);
init();
}
function preInit(namespace) {
......@@ -93,13 +93,15 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
.replace(".yaml", "");
}
function init(forceShowBody) {
function init() {
initNamespace(scope.namespace);
initOther();
scope.namespace.initialized = true;
if (forceShowBody) {
scope.showNamespaceBody = true;
}
}
function refreshNamespace() {
EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE,
{namespace: scope.namespace});
}
function initNamespace(namespace, viewType) {
......
......@@ -11,7 +11,7 @@
<button type="button" class="btn btn-default btn-sm"
data-tooltip="tooltip" data-placement="bottom" title="加载Namespace"
ng-click="init(true)">
ng-click="refreshNamespace()">
<img src="img/more.png">
加载Namespace
</button>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册