mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 13:59:23 +00:00
Handles new kind of visibility level : members
This commit is contained in:
parent
acb4e1b384
commit
059fcc72b6
@ -302,16 +302,28 @@ ComunicWeb.components.posts.form = {
|
||||
class: "post-visiblity-container"
|
||||
});
|
||||
|
||||
if(kind != "group"){
|
||||
//For posts on users page
|
||||
if(kind == "user"){
|
||||
|
||||
//Private post
|
||||
var privateLevel = ComunicWeb.components.posts.visibilityLevels.private;
|
||||
var privateInput = this._add_visiblity_choice(visibility_choices_container, "private", privateLevel.name, privateLevel.icon);
|
||||
}
|
||||
|
||||
//Friends-visible post
|
||||
var friendsLevel = ComunicWeb.components.posts.visibilityLevels.friends;
|
||||
var friendsInput = this._add_visiblity_choice(visibility_choices_container, "friends", friendsLevel.name, friendsLevel.icon);
|
||||
friendsInput.checked = true;
|
||||
}
|
||||
|
||||
//For posts on groups page
|
||||
if(kind == "group"){
|
||||
|
||||
//Members-visible posts
|
||||
var membersLevel = ComunicWeb.components.posts.visibilityLevels.friends;
|
||||
var membersInput = this._add_visiblity_choice(visibility_choices_container, "members", membersLevel.name, membersLevel.icon);
|
||||
membersInput.checked = true;
|
||||
|
||||
}
|
||||
|
||||
//Worldwide post
|
||||
var publicLevel = ComunicWeb.components.posts.visibilityLevels.public;
|
||||
|
@ -136,8 +136,18 @@ ComunicWeb.components.posts.ui = {
|
||||
});
|
||||
|
||||
//Process all visibility levels
|
||||
//For pages only
|
||||
if(infos.user_page_id != 0){
|
||||
var privateChoice = this._add_visibility_menu_item(visibilityDropdown, "private");
|
||||
var friendsChoice = this._add_visibility_menu_item(visibilityDropdown, "friends");
|
||||
}
|
||||
|
||||
//For groups only
|
||||
if(infos.group_id != 0){
|
||||
var membersChoice = this._add_visibility_menu_item(visibilityDropdown, "members");
|
||||
}
|
||||
|
||||
//Public
|
||||
var publicChoice = this._add_visibility_menu_item(visibilityDropdown, "public");
|
||||
|
||||
var onVisibilityLevelChoice = function(){
|
||||
@ -167,8 +177,14 @@ ComunicWeb.components.posts.ui = {
|
||||
}
|
||||
|
||||
//Set the items lives
|
||||
if(infos.user_page_id != 0){
|
||||
privateChoice.onclick = onVisibilityLevelChoice;
|
||||
friendsChoice.onclick = onVisibilityLevelChoice;
|
||||
}
|
||||
|
||||
if(infos.group_id != 0)
|
||||
membersChoice.onclick = onVisibilityLevelChoice;
|
||||
|
||||
publicChoice.onclick = onVisibilityLevelChoice;
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,17 @@ ComunicWeb.components.posts.visibilityLevels = {
|
||||
name: "Friends"
|
||||
},
|
||||
|
||||
/**
|
||||
* Group members
|
||||
*/
|
||||
members: {
|
||||
//Icon
|
||||
icon: "fa-users",
|
||||
|
||||
//Name
|
||||
name: "Group members"
|
||||
},
|
||||
|
||||
/**
|
||||
* Public
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user