mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
minor cleanup
This commit is contained in:
@@ -8,12 +8,12 @@ define(
|
||||
|
||||
return {
|
||||
|
||||
Bytes: function (sourceSize) {
|
||||
bytes: function (sourceSize) {
|
||||
var size = Number(sourceSize);
|
||||
return Filesize(size, 1, false);
|
||||
},
|
||||
|
||||
DateHelper: function (sourceDate) {
|
||||
dateHelper: function (sourceDate) {
|
||||
if (!sourceDate) {
|
||||
return '';
|
||||
}
|
||||
@@ -46,7 +46,7 @@ define(
|
||||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||
},
|
||||
|
||||
Number: function (input) {
|
||||
number: function (input) {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -6,17 +6,27 @@ define(
|
||||
|
||||
return {
|
||||
|
||||
startsWith: function(str, starts){
|
||||
if (starts === '') return true;
|
||||
if (str == null || starts == null) return false;
|
||||
str = String(str); starts = String(starts);
|
||||
startsWith: function (str, starts) {
|
||||
if (starts === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || starts == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
starts = String(starts);
|
||||
return str.length >= starts.length && str.slice(0, starts.length) === starts;
|
||||
},
|
||||
|
||||
endsWith: function(str, ends){
|
||||
if (ends === '') return true;
|
||||
if (str == null || ends == null) return false;
|
||||
str = String(str); ends = String(ends);
|
||||
endsWith: function (str, ends) {
|
||||
if (ends === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || ends == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
ends = String(ends);
|
||||
return str.length >= ends.length && str.slice(str.length - ends.length) === ends;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ define(
|
||||
},
|
||||
|
||||
setActive: function () {
|
||||
var storedKey = Config.GetValue(this.menu.menuKey, this.menu.defaultAction);
|
||||
var storedKey = Config.getValue(this.menu.menuKey, this.menu.defaultAction);
|
||||
|
||||
this.collection.each(function (model) {
|
||||
if (model.get('key').toLocaleLowerCase() === storedKey.toLowerCase()) {
|
||||
|
||||
@@ -37,7 +37,7 @@ define(
|
||||
|
||||
onClick: function () {
|
||||
|
||||
Config.SetValue(this.model.get('menuKey'), this.model.get('key'));
|
||||
Config.setValue(this.model.get('menuKey'), this.model.get('key'));
|
||||
this.invokeCallback();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user