mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-54944 js: ensure functions are consistent in return val
Mostly we are being incosnistent when giving an early-exit shortcut. Detected by http://eslint.org/docs/rules/consistent-return
This commit is contained in:
parent
7b7d55e11a
commit
5602dc1735
@ -288,7 +288,7 @@ define(['jquery',
|
||||
$.each(this._frameworks, function(i, f) {
|
||||
if (f.id == fid) {
|
||||
frm = f;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return frm;
|
||||
|
@ -129,7 +129,7 @@ define(['jquery',
|
||||
$.each(this._plans, function(i, f) {
|
||||
if (f.id == id) {
|
||||
plan = f;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return plan;
|
||||
|
@ -137,7 +137,7 @@ define(['jquery',
|
||||
$.each(this._rules, function(index, rule) {
|
||||
if (rule.canConfig()) {
|
||||
can = true;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return can;
|
||||
@ -163,7 +163,7 @@ define(['jquery',
|
||||
RuleConfig.prototype.display = function() {
|
||||
var self = this;
|
||||
if (!self._competency) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
return self._render().then(function(html) {
|
||||
return Str.get_string('competencyrule', 'tool_lp').then(function(title) {
|
||||
@ -276,7 +276,7 @@ define(['jquery',
|
||||
$.each(this._rules, function(index, rule) {
|
||||
if (rule.getType() == type) {
|
||||
result = rule;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
@ -297,7 +297,7 @@ define(['jquery',
|
||||
$.each(self._rulesModules, function(index, modInfo) {
|
||||
if (modInfo.type == type) {
|
||||
name = modInfo.name;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return name;
|
||||
|
@ -175,7 +175,7 @@ define(['jquery'], function($) {
|
||||
if (this.handlers) {
|
||||
$.each(this.handlers, function(selector, handler) {
|
||||
if (eventHandled) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (item.find(selector).length > 0) {
|
||||
var callable = $.proxy(handler, anchor);
|
||||
|
@ -66,7 +66,7 @@ function(Y, $, log) {
|
||||
setupTargetRegion: function() {
|
||||
var targetRegion = $('#' + notificationModule.fieldName);
|
||||
if (targetRegion.length) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var newRegion = $('<span>').attr('id', notificationModule.fieldName);
|
||||
|
@ -102,7 +102,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
var form = $(this).closest('form').get(0),
|
||||
cnt = $(form).find("input[type=checkbox]:checked").length;
|
||||
if (!cnt) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
|
||||
e.preventDefault();
|
||||
@ -134,7 +134,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
notification.alert(s[0], s[1], s[2]);
|
||||
}
|
||||
);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
|
||||
str.get_strings([
|
||||
|
@ -138,13 +138,13 @@ define(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lt
|
||||
*/
|
||||
var submitCartridgeURL = function() {
|
||||
if (isLoading()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = getCartridgeURL();
|
||||
// No URL? Do nothing.
|
||||
if (url === "") {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
startLoading();
|
||||
|
Loading…
x
Reference in New Issue
Block a user