const pageId = Number($attrs.pageId);
$scope.tags = [];
+
+ $scope.sortOptions = {
+ handle: '.handle',
+ items: '> tr',
+ containment: "parent",
+ axis: "y"
+ };
/**
* Push an empty tag to the end of the scope tags.
value: ''
});
}
+ $scope.addEmptyTag = addEmptyTag;
/**
* Get all tags for the current book and add into scope.
}
};
+ /**
+ * Save the tags to the current page.
+ */
$scope.saveTags = function() {
setTagOrder();
let postData = {tags: $scope.tags};
})
};
+ /**
+ * Remove a tag from the current list.
+ * @param tag
+ */
+ $scope.removeTag = function(tag) {
+ let cIndex = $scope.tags.indexOf(tag);
+ $scope.tags.splice(cIndex, 1);
+ };
+
}]);
};