/**
* Save a draft update into the system via an AJAX request.
- * @param title
- * @param html
*/
function saveDraft() {
var data = {
var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate();
$scope.draftText = responseData.data.message + moment(updateTime).format('HH:mm');
if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true;
+ showDraftSaveNotification();
});
}
+ function showDraftSaveNotification() {
+ $scope.draftUpdated = true;
+ $timeout(() => {
+ $scope.draftUpdated = false;
+ }, 2000)
+ }
+
$scope.forceDraftSave = function() {
saveDraft();
};
</div>
<div class="col-sm-4 faded text-center">
- <div dropdown class="dropdown-container">
+ <div dropdown class="dropdown-container draft-display">
<a dropdown-toggle class="text-primary text-button"><span class="faded-text" ng-bind="draftText"></span> <i class="zmdi zmdi-more-vert"></i></a>
+ <i class="zmdi zmdi-check-circle text-pos draft-notification" ng-class="{visible: draftUpdated}"></i>
<ul>
<li>
<a ng-click="forceDraftSave()" class="text-pos"><i class="zmdi zmdi-save"></i>Save Draft</a>