projecten

This commit is contained in:
2018-01-18 08:45:09 +01:00
parent 00246f49f7
commit 970aa53971
25 changed files with 689 additions and 285 deletions
+48
View File
@@ -0,0 +1,48 @@
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/01/2018
* Time: 16:28
*/
dbo.commentModel = {
comment : ko.observable(),
commentID: null,
callback : null,
options : {
// disable wrapping content with paragraphs
// instead <br> will be used
enter : $.FroalaEditor.ENTER_DIV,
key : 'zc1QXIa2QZe1UOXATEX==',
// we like gray!
theme : 'gray',
toolbarButtons: ['bold', 'italic', 'underline']
},
showComment: function ( commentID, callback ) {
var vm = dbo.commentModel;
vm.callback = callback;
vm.commentID = commentID;
$( "#comment-modal" ).modal( 'show' );
dbo.commentsDataService.getComment( vm.commentID, function ( data ) {
vm.comment( data.comment );
} );
},
saveComment: function () {
var vm = dbo.commentModel;
dbo.commentsDataService.saveComment( vm.commentID, vm.comment(), function () {
$( "#comment-modal" ).modal( 'hide' );
vm.callback();
} );
}
}
ko.applyBindings( dbo.commentModel, document.getElementById( 'comment-modal' ) );