Edit save + git commit + push sync
This commit is contained in:
		| @@ -11,7 +11,21 @@ if($('#page-type-edit').length) { | ||||
|  | ||||
| 	$('.btn-edit-save').on('click', (ev) => { | ||||
|  | ||||
| 		 | ||||
| 		$.ajax(window.location.href, { | ||||
| 			data: { | ||||
| 				markdown: mde.value() | ||||
| 			}, | ||||
| 			dataType: 'json', | ||||
| 			method: 'PUT' | ||||
| 		}).then((rData, rStatus, rXHR) => { | ||||
| 			if(rData.ok) { | ||||
| 				window.location.assign('/' + $('#page-type-edit').data('entrypath')); | ||||
| 			} else { | ||||
| 				alerts.pushError('Something went wrong', rData.error); | ||||
| 			} | ||||
| 		}, (rXHR, rStatus, err) => { | ||||
| 			alerts.pushError('Something went wrong', 'Save operation failed.'); | ||||
| 		}); | ||||
|  | ||||
| 	}); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user