Linting fixes to improve quality report
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
this.clearSearch();
|
||||
},
|
||||
|
||||
showErrorMessage: function (error) {
|
||||
showErrorMessage: function(error) {
|
||||
this.$message.text(gettext(error || 'There was an error, try searching again.'));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ describe('Program Progress View', () => {
|
||||
model: programModel,
|
||||
courseModel: courseData,
|
||||
certificateCollection,
|
||||
programRecordUrl: '/foo/bar'
|
||||
programRecordUrl: '/foo/bar',
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -101,7 +101,7 @@ class UnenrollView extends Backbone.View {
|
||||
this.mainPageSelector = '#dashboard-main';
|
||||
|
||||
this.triggerSelector = '.action-unenroll';
|
||||
$(this.triggerSelector).each(function attachTriggerHandler(index, element) {
|
||||
$(this.triggerSelector).each((index, element) => {
|
||||
$(element).on('click', view.handleTrigger.bind($(element)));
|
||||
});
|
||||
|
||||
|
||||
@@ -4,18 +4,18 @@ function playVideo(src) {
|
||||
document.querySelector('#program_video iframe').style = 'display:block;';
|
||||
document.querySelector('#program_video iframe').src = src;
|
||||
}
|
||||
$(".instructor-image, .instructor-label").leanModal({closeButton: ".modal_close", top: '10%'});
|
||||
$('.instructor-image, .instructor-label').leanModal({closeButton: '.modal_close', top: '10%'});
|
||||
// Create MutationObserver which prevents the body of
|
||||
// the page from scrolling when a modal window is displayed
|
||||
var observer = new MutationObserver(function(mutations, obv){
|
||||
mutations.forEach(function(mutation) {
|
||||
if ($(mutation.target).css('display') === 'block') {
|
||||
$('body').css('overflow','hidden');
|
||||
} else {
|
||||
$('body').css('overflow', 'auto');
|
||||
}
|
||||
});
|
||||
var observer = new MutationObserver(function(mutations, obv) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if ($(mutation.target).css('display') === 'block') {
|
||||
$('body').css('overflow', 'hidden');
|
||||
} else {
|
||||
$('body').css('overflow', 'auto');
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.modal').each(function(index, element) {
|
||||
observer.observe(element, {attributes: true, attributeFilter: ['style']});
|
||||
});
|
||||
$('.modal').each(function(index, element){
|
||||
observer.observe(element, {attributes: true, attributeFilter:['style']});
|
||||
});
|
||||
@@ -156,7 +156,7 @@ define([
|
||||
var requests = AjaxHelpers.requests(this);
|
||||
$('.discovery-input').val('asdfasdf');
|
||||
$('.discovery-submit').trigger('click');
|
||||
AjaxHelpers.respondWithError(requests, 404, {'error': 'some-search-error'});
|
||||
AjaxHelpers.respondWithError(requests, 404, {error: 'some-search-error'});
|
||||
expect($('#discovery-message')).not.toBeEmpty();
|
||||
expect($('#discovery-message')).toContainHtml('some-search-error');
|
||||
expect($('.courses-listing')).toBeEmpty();
|
||||
|
||||
@@ -45,11 +45,10 @@
|
||||
// If we successfully enrolled, redirect the user
|
||||
// to the next page (usually the student dashboard or payment flow)
|
||||
if (response.redirect_destination) {
|
||||
this.redirect(response.redirect_destination)
|
||||
this.redirect(response.redirect_destination);
|
||||
} else if (redirectUrl) {
|
||||
this.redirect(redirectUrl);
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user