Merge pull request #4599 from umbraco/temp8-fix-umbeditornavigation-4478
v8 Fixes umbeditornavigation.directive
This commit is contained in:
@@ -46,18 +46,15 @@
|
||||
};
|
||||
|
||||
function onInit() {
|
||||
|
||||
// hide navigation if there is only 1 item
|
||||
if (scope.navigation.length <= 1) {
|
||||
scope.showNavigation = false;
|
||||
}
|
||||
|
||||
$timeout(function(){
|
||||
if($window && $window.innerWidth) {
|
||||
calculateVisibleItems($window.innerWidth);
|
||||
}
|
||||
});
|
||||
|
||||
var firstRun = true;
|
||||
scope.$watch("navigation.length",
|
||||
(newVal, oldVal) => {
|
||||
if (firstRun || newVal !== undefined && newVal !== oldVal) {
|
||||
firstRun = false;
|
||||
scope.showNavigation = newVal > 1;
|
||||
calculateVisibleItems($window.innerWidth);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function calculateVisibleItems(windowWidth) {
|
||||
|
||||
@@ -157,6 +157,7 @@ app.config(function ($routeProvider) {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: Fix this special case by using components, the packager should be a component and then we just have a view for each route like normal rendering the component with the correct parameters
|
||||
//special case for the package section
|
||||
var packagePages = ["edit", "options"];
|
||||
if ($routeParams.section.toLowerCase() === "packages" && $routeParams.tree.toLowerCase() === "packages" && packagePages.indexOf($routeParams.method.toLowerCase()) === -1) {
|
||||
@@ -164,6 +165,7 @@ app.config(function ($routeProvider) {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: Fix this special case by using components, the users section should be a component and then we just have a view for each route like normal rendering the component with the correct parameters
|
||||
//special case for the users section
|
||||
var usersPages = ["user", "group"];
|
||||
if ($routeParams.section.toLowerCase() === "users" && $routeParams.tree.toLowerCase() === "users" && usersPages.indexOf($routeParams.method.toLowerCase()) === -1) {
|
||||
|
||||
Reference in New Issue
Block a user