File tree 1 file changed +15
-11
lines changed
1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ <h3>Schema</h3>
270
270
// Load data from gist.
271
271
if ( window . location . hash . length > 4 ) {
272
272
$scope . navbarMode = 'loaded' ;
273
- var gistId = window . location . hash . replace ( / [ \# \/ ] * / g, '' ) ;
273
+ var gistId = window . location . hash . replace ( / [ \! \ #\/ ] * / g, '' ) ;
274
274
$scope . loading = true ;
275
275
$http . get ( 'https://api.github.com/gists/' + gistId )
276
276
. then ( function ( response ) {
@@ -377,16 +377,20 @@ <h3>Schema</h3>
377
377
} ;
378
378
379
379
$http . post ( 'https://api.github.com/gists' , gist )
380
- . then ( function ( data ) {
381
- $scope . error = null ;
382
- $location . hash ( data . id ) ;
383
- $scope . savedGistData = {
384
- data : data ,
385
- url : $location . absUrl ( )
386
- } ;
387
- } , function ( ) {
388
- $scope . error = 'Failed to save gist.' ;
389
- } ) ;
380
+ . then ( function ( response ) {
381
+ $scope . error = null ;
382
+ //$location.hash(response.data.id);
383
+ window . location . hash = response . data . id ;
384
+ window . location . hash = response . data . id ;
385
+ $scope . savedGistData = {
386
+ data : response . data ,
387
+ url : $location . absUrl ( )
388
+ } ;
389
+ } ,
390
+ function ( ) {
391
+ $scope . error = 'Failed to save gist.' ;
392
+ }
393
+ ) ;
390
394
} ;
391
395
392
396
$scope . submitForm = function ( form ) {
You can’t perform that action at this time.
0 commit comments