mirror of
https://github.com/digitalocean/nginxconfig.io
synced 2024-11-10 12:34:12 +00:00
handle updating hash
This commit is contained in:
parent
fb9e647c13
commit
3b5ab8ff30
1 changed files with 13 additions and 0 deletions
|
@ -265,6 +265,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
$scope.updatingHash = true;
|
||||
|
||||
var changedData = {};
|
||||
for (var key in $scope.data) {
|
||||
if (!angular.equals($scope.data[key], $scope.defaultData[key])) {
|
||||
|
@ -295,6 +297,10 @@
|
|||
$scope.isDirty = false;
|
||||
$location.search({});
|
||||
}
|
||||
|
||||
$timeout(function() {
|
||||
$scope.updatingHash = false;
|
||||
});
|
||||
}
|
||||
|
||||
function initMasonry() {
|
||||
|
@ -362,6 +368,7 @@
|
|||
$scope.defaultData = DEFAULTS;
|
||||
|
||||
$scope.dataInit = false;
|
||||
$scope.updatingHash = false;
|
||||
$scope.data = angular.copy($scope.defaultData);
|
||||
$scope.isDirty = false;
|
||||
$scope.masonryInit = false;
|
||||
|
@ -1336,6 +1343,12 @@
|
|||
}
|
||||
}, true);
|
||||
|
||||
$scope.$on('$locationChangeSuccess', function(){
|
||||
if (!$scope.updatingHash) {
|
||||
setDataFromHash();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//////////
|
||||
|
|
Loading…
Reference in a new issue