mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1244916 - JSON Viewer: empty arrays should hide the zero count. r=odvarko
This commit is contained in:
parent
adfcd55bb8
commit
806745713c
@ -127,7 +127,8 @@ define(function (require, exports, module) {
|
||||
let items;
|
||||
|
||||
if (mode == "tiny") {
|
||||
items = DOM.span({className: "length"}, object.length);
|
||||
let isEmpty = object.length === 0;
|
||||
items = DOM.span({className: "length"}, isEmpty ? "" : object.length);
|
||||
} else {
|
||||
let max = (mode == "short") ? 3 : 300;
|
||||
items = this.arrayIterator(object, max);
|
||||
|
@ -108,7 +108,9 @@ define(function (require, exports, module) {
|
||||
let items;
|
||||
|
||||
if (mode == "tiny") {
|
||||
items = span({className: "length"}, this.getLength(object));
|
||||
let objectLength = this.getLength(object);
|
||||
let isEmpty = objectLength === 0;
|
||||
items = span({className: "length"}, isEmpty ? "" : objectLength);
|
||||
} else {
|
||||
let max = (mode == "short") ? 3 : 300;
|
||||
items = this.arrayIterator(object, max);
|
||||
|
@ -64,7 +64,7 @@ window.onload = Task.async(function* () {
|
||||
},
|
||||
{
|
||||
mode: "tiny",
|
||||
expectedOutput: `[0]`,
|
||||
expectedOutput: `[]`,
|
||||
},
|
||||
{
|
||||
mode: "short",
|
||||
|
@ -57,7 +57,7 @@ window.onload = Task.async(function* () {
|
||||
},
|
||||
{
|
||||
mode: "tiny",
|
||||
expectedOutput: `[0]`,
|
||||
expectedOutput: `[]`,
|
||||
},
|
||||
{
|
||||
mode: "short",
|
||||
|
Loading…
Reference in New Issue
Block a user