Commit 68714d9e by Douglas Cerna Committed by Alex Dusenbery

Fixed quality errors

parent 94bea7a7
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
topicId: discussionId, topicId: discussionId,
startHeader: this.startHeader, startHeader: this.startHeader,
is_commentable_divided: response.is_commentable_divided, is_commentable_divided: response.is_commentable_divided,
user_group_id: response.user_group_id, user_group_id: response.user_group_id
}); });
this.newPostView.render(); this.newPostView.render();
......
...@@ -112,21 +112,21 @@ ...@@ -112,21 +112,21 @@
NewPostView.prototype.getGroupName = function() { NewPostView.prototype.getGroupName = function() {
var userGroupId; var userGroupId;
var group; var group;
var group_name = null; var groupName = null;
if (this.course_settings.get('is_discussion_division_enabled')) { if (this.course_settings.get('is_discussion_division_enabled')) {
userGroupId = $('#discussion-container').data('user-group-id'); userGroupId = $('#discussion-container').data('user-group-id');
if (!userGroupId) { if (!userGroupId) {
userGroupId = this.user_group_id; userGroupId = this.user_group_id;
} }
group = this.course_settings.get('groups').find(function(group) { group = this.course_settings.get('groups').find(function(courseSettingsGroup) {
return group.id == userGroupId; return courseSettingsGroup.id === String(userGroupId);
}); });
if (group) { if (group) {
group_name = group.name; groupName = group.name;
} }
} }
return group_name; return groupName;
}; };
NewPostView.prototype.events = { NewPostView.prototype.events = {
...@@ -150,15 +150,15 @@ ...@@ -150,15 +150,15 @@
} }
}; };
NewPostView.prototype.updateVisibilityMessage = function($target, force_divided) { NewPostView.prototype.updateVisibilityMessage = function($target, forceDivided) {
var visEl = $('.group-visibility .field-label-text'); var $visEl = $('.group-visibility .field-label-text');
var visTemplate = edx.HtmlUtils.template($('#new-post-visibility-template').html()); var visTemplate = edx.HtmlUtils.template($('#new-post-visibility-template').html());
var group_name = null; var groupName = null;
if (($target && $target.data('divided')) || force_divided) { if (($target && $target.data('divided')) || forceDivided) {
group_name = this.group_name; groupName = this.group_name;
} }
edx.HtmlUtils.setHtml(visEl, visTemplate({group_name: group_name})); edx.HtmlUtils.setHtml($visEl, visTemplate({group_name: groupName}));
}; };
NewPostView.prototype.postOptionChange = function(event) { NewPostView.prototype.postOptionChange = function(event) {
......
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