1
- angular . module ( "umbraco" ) . controller ( "Our.Umbraco.DocTypeGridEditor.GridEditors.DocTypeGridEditor" , [
1
+ angular . module ( "umbraco" ) . controller ( "Our.Umbraco.DocTypeGridEditor.GridEditors.DocTypeGridEditor" , [
2
2
3
3
"$scope" ,
4
4
"$rootScope" ,
@@ -239,8 +239,9 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
239
239
"blueprintConfig" ,
240
240
"contentEditingHelper" ,
241
241
"serverValidationManager" ,
242
+ "$routeParams" ,
242
243
243
- function ( $scope , $interpolate , formHelper , contentResource , dtgeResources , dtgeUtilityService , blueprintConfig , contentEditingHelper , serverValidationManager ) {
244
+ function ( $scope , $interpolate , formHelper , contentResource , dtgeResources , dtgeUtilityService , blueprintConfig , contentEditingHelper , serverValidationManager , $routeParams ) {
244
245
245
246
var vm = this ;
246
247
vm . submit = submit ;
@@ -269,6 +270,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
269
270
$scope . model . node . variants [ 0 ] . name = $scope . model . node . name
270
271
$scope . model . node . variants [ 0 ] . save = true ;
271
272
273
+ // Reset route create to prevent showing up the changed content dialog
274
+ var routeParamsCreate = $routeParams . create ;
275
+ $routeParams . create = undefined ;
276
+
272
277
// save the content as a blueprint, to trigger validation
273
278
var args = {
274
279
saveMethod : contentResource . saveBlueprint ,
@@ -282,10 +287,14 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
282
287
283
288
contentEditingHelper . contentEditorPerformSave ( args ) . then ( function ( data ) {
284
289
$scope . model . submit ( $scope . model ) ;
290
+ // Reset original value of $routeParams.create
291
+ $routeParams . create = routeParamsCreate ;
285
292
} ,
286
- function ( err ) {
287
- // cleanup the blueprint immediately
288
- cleanup ( ) ;
293
+ function ( err ) {
294
+ // Set original value of $routeParams.create
295
+ $routeParams . create = routeParamsCreate ;
296
+ // cleanup the blueprint immediately
297
+ cleanup ( ) ;
289
298
} ) ;
290
299
}
291
300
}
0 commit comments