зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1003860 - Various tweaks to the storage inspector. r=mratcliffe
This commit is contained in:
Родитель
a6f117c118
Коммит
25bba3377c
|
@ -57,7 +57,10 @@ StoragePanel.prototype = {
|
|||
this.emit("ready");
|
||||
|
||||
return this;
|
||||
}).catch(this.destroy);
|
||||
}).catch(e => {
|
||||
console.log("error while opening storage panel", e);
|
||||
this.destroy();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -487,6 +487,7 @@ function* selectTreeItem(ids) {
|
|||
|
||||
let selector = "[data-id='" + JSON.stringify(ids) + "'] > .tree-widget-item";
|
||||
let target = gPanelWindow.document.querySelector(selector);
|
||||
ok(target, "tree item found with ids " + JSON.stringify(ids));
|
||||
|
||||
let updated = gUI.once("store-objects-updated");
|
||||
|
||||
|
@ -503,6 +504,7 @@ function* selectTreeItem(ids) {
|
|||
function* selectTableItem(id) {
|
||||
let selector = ".table-widget-cell[data-id='" + id + "']";
|
||||
let target = gPanelWindow.document.querySelector(selector);
|
||||
ok(target, "table item found with ids " + id);
|
||||
|
||||
yield click(target);
|
||||
yield gUI.once("sidebar-updated");
|
||||
|
|
|
@ -341,11 +341,16 @@ StorageUI.prototype = {
|
|||
populateStorageTree: function(storageTypes) {
|
||||
this.storageTypes = {};
|
||||
for (let type in storageTypes) {
|
||||
// Ignore `from` field, which is just a protocol.js implementation artifact
|
||||
if (type === "from") {
|
||||
continue;
|
||||
}
|
||||
|
||||
let typeLabel = L10N.getStr("tree.labels." + type);
|
||||
let typeLabel = type;
|
||||
try {
|
||||
typeLabel = L10N.getStr("tree.labels." + type);
|
||||
} catch(e) {
|
||||
console.error("Unable to localize tree label type:" + type);
|
||||
}
|
||||
this.tree.add([{id: type, label: typeLabel, type: "store"}]);
|
||||
if (!storageTypes[type].hosts) {
|
||||
continue;
|
||||
|
@ -568,7 +573,12 @@ StorageUI.prototype = {
|
|||
if (!uniqueKey) {
|
||||
this.table.uniqueId = uniqueKey = key;
|
||||
}
|
||||
columns[key] = L10N.getStr("table.headers." + type + "." + key);
|
||||
columns[key] = key;
|
||||
try {
|
||||
columns[key] = L10N.getStr("table.headers." + type + "." + key);
|
||||
} catch(e) {
|
||||
console.error("Unable to localize table header type:" + type + " key:" + key);
|
||||
}
|
||||
}
|
||||
this.table.setColumns(columns, null, HIDDEN_COLUMNS);
|
||||
this.shouldResetColumns = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче