mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 08:54:33 +08:00
Moved page editing to angular controller and started work on update drafts
This commit is contained in:
@ -162,5 +162,31 @@ module.exports = function (ngApp, events) {
|
||||
};
|
||||
}]);
|
||||
|
||||
ngApp.directive('tinymce', [function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
tinymce: '=',
|
||||
ngModel: '=',
|
||||
ngChange: '='
|
||||
},
|
||||
link: function (scope, element, attrs) {
|
||||
|
||||
function tinyMceSetup(editor) {
|
||||
editor.on('keyup', (e) => {
|
||||
var content = editor.getContent();
|
||||
scope.$apply(() => {
|
||||
scope.ngModel = content;
|
||||
});
|
||||
scope.ngChange(content);
|
||||
});
|
||||
}
|
||||
|
||||
scope.tinymce.extraSetups.push(tinyMceSetup);
|
||||
tinymce.init(scope.tinymce);
|
||||
}
|
||||
}
|
||||
}])
|
||||
|
||||
|
||||
};
|
Reference in New Issue
Block a user