fix: url did not update correctly when closing settings view by using ESC key, fixes #8869

This commit is contained in:
Torkel Ödegaard
2017-07-24 12:21:30 +02:00
parent cff1c37064
commit 2d2800e710
4 changed files with 29 additions and 24 deletions

View File

@@ -25,7 +25,6 @@ function ($, angular, coreModule) {
function hideEditorPane(hideToShowOtherView) {
if (editorScope) {
editorScope.dismiss(hideToShowOtherView);
scope.appEvent('dash-editor-hidden');
}
}
@@ -61,7 +60,15 @@ function ($, angular, coreModule) {
var urlParams = $location.search();
if (options.editview === urlParams.editview) {
delete urlParams.editview;
$location.search(urlParams);
// even though we always are in apply phase here
// some angular bug is causing location search updates to
// not happen always so this is a hack fix or that
setTimeout(function() {
$rootScope.$apply(function() {
$location.search(urlParams);
});
});
}
}
};