Commit 9683e15a authored by aurelien's avatar aurelien
Browse files

ouverture et fonctonnement de la modale de publication

parent 92ee4244
......@@ -88,7 +88,7 @@ root.controller('ProjectBlogCtrl', ['$scope', '$stateParams', '$http', '$state',
$blogFactory.addArticle($scope._getProject(),data.visibility,data.title, data.content, data.thumbUrl, data.shortDescription, function(data){
if(data.status == "success"){
$scope._showAlert({status:1,message:$languageFactory._labels.alerts_newBlogArticleSuccess});
//$scope._setLocation('p',blogCtrl.shortName,'blog/');
$scope._setLocation('p',blogCtrl.shortName,'blog/');
$state.go('project.blog',{projectName:blogCtrl.shortName, action:""});
}
else{
......@@ -175,7 +175,7 @@ root.controller('ProjectBlogCtrl', ['$scope', '$stateParams', '$http', '$state',
blogCtrl.initNewArticle = function (){
$scope._log("new Article");
blogCtrl.editor.label = $languageFactory._labels.addArticleBtn;
//blogCtrl.editor.label = $languageFactory._labels.addArticleBtn;
blogCtrl.currentArticle = undefined;
blogCtrl.editMode = true;
......@@ -184,10 +184,12 @@ root.controller('ProjectBlogCtrl', ['$scope', '$stateParams', '$http', '$state',
blogCtrl.initEditor = function(){
if(blogCtrl.CKEditor ==undefined){
$scope._log("init editor");
blogCtrl.CKEditor = CKEDITOR.replace( 'articleEditor' );
}
blogCtrl.CKEditor=CKEDITOR.replace('articleEditor');
console.log(CKEditor);
}
if(blogCtrl.currentArticle !=undefined){
console.log("2 if inieditor");
blogCtrl.thumbUrl = blogCtrl.currentArticle.thumbUrl;
$("#inputArticleTitle").val(blogCtrl.currentArticle.title);
......@@ -292,12 +294,17 @@ root.controller('ProjectBlogCtrl', ['$scope', '$stateParams', '$http', '$state',
blogCtrl.initNewArticle();
}
else {
//blogCtrl.editArticle();
blogCtrl.editArticle();
}
}
blogCtrl.openModalNewAdmin = function(){
$("#newAdminModal").removeClass("hide")
$("#newAdminModal").show()
}
blogCtrl.init();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment