|
|
|
@ -402,17 +402,16 @@ function attachEvents() {
|
|
|
|
|
|
|
|
|
|
var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection");
|
|
|
|
|
shareGroupNewRoleFromSelectionLink.click(function () {
|
|
|
|
|
var roles = [];
|
|
|
|
|
$('.modal .roleCheckBoxes').each(
|
|
|
|
|
function () {
|
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
|
roles.push($(this).data('role-name'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
var roles = $("#roles").val();
|
|
|
|
|
if (roles && roles.length >= 2) {
|
|
|
|
|
addNewRole(roles);
|
|
|
|
|
// $(modalPopupContent).html($('#share-group-w3-modal-content').html());
|
|
|
|
|
// createNewRole(roles);
|
|
|
|
|
} else {
|
|
|
|
|
var errorMsgWrapper = "#notification-error-msg";
|
|
|
|
|
var errorMsg = "#notification-error-msg span";
|
|
|
|
|
$(errorMsg).text("To create a new role with the combination of roles, at least two roles should be" +
|
|
|
|
|
" selected.");
|
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -534,8 +533,8 @@ function listAllRoles(groupId) {
|
|
|
|
|
html += '</select>';
|
|
|
|
|
$("#rolesListing").html(html);
|
|
|
|
|
markAlreadySavedUsersRoles(groupId);
|
|
|
|
|
$("select.select2[multiple=multiple]").select2({
|
|
|
|
|
tags: false
|
|
|
|
|
$("select.select2[multiple=multiple]").select2({tags: false}).on("select2:select", function () {
|
|
|
|
|
$("#notification-error-msg").addClass("hidden");
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$("#rolesListing").html("No roles available");
|
|
|
|
|