mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
lint: attribute pool
This commit is contained in:
parent
a4e2ea7a8c
commit
6e5d674dda
1 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This code represents the Attribute Pool Object of the original Etherpad.
|
* This code represents the Attribute Pool Object of the original Etherpad.
|
||||||
* 90% of the code is still like in the original Etherpad
|
* 90% of the code is still like in the original Etherpad
|
||||||
|
@ -70,9 +72,11 @@ AttributePool.prototype.getAttribValue = function (num) {
|
||||||
|
|
||||||
AttributePool.prototype.eachAttrib = function (func) {
|
AttributePool.prototype.eachAttrib = function (func) {
|
||||||
for (const n in this.numToAttrib) {
|
for (const n in this.numToAttrib) {
|
||||||
|
if (this.numToAttrib[n]) {
|
||||||
const pair = this.numToAttrib[n];
|
const pair = this.numToAttrib[n];
|
||||||
func(pair[0], pair[1]);
|
func(pair[0], pair[1]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AttributePool.prototype.toJsonable = function () {
|
AttributePool.prototype.toJsonable = function () {
|
||||||
|
@ -87,8 +91,10 @@ AttributePool.prototype.fromJsonable = function (obj) {
|
||||||
this.nextNum = obj.nextNum;
|
this.nextNum = obj.nextNum;
|
||||||
this.attribToNum = {};
|
this.attribToNum = {};
|
||||||
for (const n in this.numToAttrib) {
|
for (const n in this.numToAttrib) {
|
||||||
|
if (this.numToAttrib[n]) {
|
||||||
this.attribToNum[String(this.numToAttrib[n])] = Number(n);
|
this.attribToNum[String(this.numToAttrib[n])] = Number(n);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue