Fixes: U4-2655 double-click to force reload
This commit is contained in:
@@ -16,12 +16,6 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
scope.nav = navigationService;
|
||||
|
||||
|
||||
/*
|
||||
scope.$watch("currentSection", function (newVal, oldVal) {
|
||||
scope.currentSection = newVal;
|
||||
});
|
||||
*/
|
||||
|
||||
function loadSections(){
|
||||
sectionResource.getSections()
|
||||
.then(function (result) {
|
||||
@@ -70,8 +64,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
};
|
||||
|
||||
scope.sectionDblClick = function(section){
|
||||
treeService.clearCache(section.alias);
|
||||
navigationService.changeSection(section.alias);
|
||||
navigationService.reloadSection(section.alias);
|
||||
};
|
||||
|
||||
scope.trayClick = function(){
|
||||
|
||||
@@ -68,10 +68,13 @@ angular.module("umbraco.directives")
|
||||
function setupExternalEvents() {
|
||||
if (scope.eventhandler) {
|
||||
|
||||
//TODO: This will *never* do anything because we dont cache trees by tree alias!!
|
||||
// Have changed this to clear all tree cache.
|
||||
scope.eventhandler.clearCache = function(treeAlias){
|
||||
treeService.clearCache();
|
||||
scope.eventhandler.clearCache = function(section){
|
||||
treeService.clearCache(section);
|
||||
};
|
||||
|
||||
scope.eventhandler.load = function(section){
|
||||
scope.section = section;
|
||||
loadTree();
|
||||
};
|
||||
|
||||
scope.eventhandler.syncPath = function(path, forceReload){
|
||||
|
||||
@@ -148,13 +148,16 @@ angular.module('umbraco.services')
|
||||
* and load the dashboard related to the section
|
||||
* @param {string} sectionAlias The alias of the section
|
||||
*/
|
||||
changeSection: function (sectionAlias) {
|
||||
if (this.ui.stickyNavigation) {
|
||||
setMode("default-opensection");
|
||||
this.ui.currentSection = sectionAlias;
|
||||
this.showTree(sectionAlias);
|
||||
changeSection: function (sectionAlias, force) {
|
||||
setMode("default-opensection");
|
||||
|
||||
if(force && this.ui.currentSection === sectionAlias){
|
||||
this.ui.currentSection = "";
|
||||
}
|
||||
|
||||
this.ui.currentSection = sectionAlias;
|
||||
this.showTree(sectionAlias);
|
||||
|
||||
$location.path(sectionAlias);
|
||||
},
|
||||
|
||||
@@ -283,6 +286,13 @@ angular.module('umbraco.services')
|
||||
}
|
||||
},
|
||||
|
||||
reloadSection: function (sectionAlias) {
|
||||
if(this.ui.treeEventHandler){
|
||||
this.ui.treeEventHandler.clearCache(sectionAlias);
|
||||
this.ui.treeEventHandler.load(sectionAlias);
|
||||
}
|
||||
},
|
||||
|
||||
setActiveTreeType: function (treeAlias) {
|
||||
if(this.ui.treeEventHandler){
|
||||
this.ui.treeEventHandler.setActiveTreeType(treeAlias);
|
||||
|
||||
Reference in New Issue
Block a user