mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 12:04:10 +00:00
[WebUI] Fix prettier javascript issue
Prettier removed too many parentheses in asIPAdress and when minifying the plus unary combined with the plus operator to create an incorrect increment operator. So skip prettier formatting this secion of code. Also fix an ECMA5 warning from closure about function scope in FilesTab.
This commit is contained in:
parent
80178f7310
commit
bb93a06fff
@ -19,11 +19,12 @@ Ext.namespace('Deluge.data');
|
||||
* @singleton
|
||||
*/
|
||||
Deluge.data.SortTypes = {
|
||||
// prettier-ignore
|
||||
asIPAddress: function(value) {
|
||||
var d = value.match(
|
||||
/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/
|
||||
);
|
||||
return ((+d[1] * 256 + +d[2]) * 256 + +d[3]) * 256 + +d[4];
|
||||
return ((+d[1] * 256 + (+d[2])) * 256 + (+d[3])) * 256 + (+d[4]);
|
||||
},
|
||||
|
||||
asQueuePosition: function(value) {
|
||||
|
@ -179,21 +179,21 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
||||
break;
|
||||
default:
|
||||
var indexes = {};
|
||||
function walk(node) {
|
||||
var walk = function(node) {
|
||||
if (Ext.isEmpty(node.attributes.fileIndex)) return;
|
||||
indexes[node.attributes.fileIndex] =
|
||||
node.attributes.priority;
|
||||
}
|
||||
};
|
||||
this.getRootNode().cascade(walk);
|
||||
|
||||
var nodes = this.getSelectionModel().getSelectedNodes();
|
||||
Ext.each(nodes, function(node) {
|
||||
if (!node.isLeaf()) {
|
||||
function setPriorities(node) {
|
||||
var setPriorities = function(node) {
|
||||
if (Ext.isEmpty(node.attributes.fileIndex)) return;
|
||||
indexes[node.attributes.fileIndex] =
|
||||
baseItem.filePriority;
|
||||
}
|
||||
};
|
||||
node.cascade(setPriorities);
|
||||
} else if (!Ext.isEmpty(node.attributes.fileIndex)) {
|
||||
indexes[node.attributes.fileIndex] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user