Bug 1207491 - Part 10: Remove use of expression closure from browser/components/places/content/. r=Gijs

--HG--
extra : commitid : LlW5LSkRgzy
extra : rebase_source : 1b1038758a0c4b83fe8e00ebe397065def10cf7c
This commit is contained in:
Tooru Fujisawa 2015-09-23 18:36:21 +09:00
Родитель cfd67ac66e
Коммит 3fc2581f0c
7 изменённых файлов: 55 добавлений и 29 удалений

Просмотреть файл

@ -20,6 +20,5 @@ function searchBookmarks(aSearchString) {
}
window.addEventListener("SidebarFocused",
function()
document.getElementById("search-box").focus(),
() => document.getElementById("search-box").focus(),
false);

Просмотреть файл

@ -59,7 +59,9 @@ InsertionPoint.prototype = {
return this._index = val;
},
promiseGuid: function () PlacesUtils.promiseItemGuid(this.itemId),
promiseGuid: function () {
return PlacesUtils.promiseItemGuid(this.itemId);
},
get index() {
if (this.dropNearItemId > 0) {
@ -71,7 +73,9 @@ InsertionPoint.prototype = {
return this._index;
},
get isTag() typeof(this.tagName) == "string"
get isTag() {
return typeof(this.tagName) == "string";
}
};
/**
@ -1199,7 +1203,9 @@ PlacesController.prototype = {
},
_cutNodes: [],
get cutNodes() this._cutNodes,
get cutNodes() {
return this._cutNodes;
},
set cutNodes(aNodes) {
let self = this;
function updateCutNodes(aValue) {
@ -1268,7 +1274,7 @@ PlacesController.prototype = {
[ PlacesUtils.TYPE_X_MOZ_PLACE,
PlacesUtils.TYPE_X_MOZ_URL,
PlacesUtils.TYPE_UNICODE,
].forEach(function (type) xferable.addDataFlavor(type));
].forEach(type => xferable.addDataFlavor(type));
this.clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard);
@ -1388,8 +1394,9 @@ PlacesController.prototype = {
* @return true if there's a cached mozILivemarkInfo object for
* aNode, false otherwise.
*/
hasCachedLivemarkInfo: function PC_hasCachedLivemarkInfo(aNode)
this._cachedLivemarkInfoObjects.has(aNode),
hasCachedLivemarkInfo: function PC_hasCachedLivemarkInfo(aNode) {
return this._cachedLivemarkInfoObjects.has(aNode);
},
/**
* Returns the cached livemark info for a node, if set by cacheLivemarkInfo,
@ -1398,8 +1405,9 @@ PlacesController.prototype = {
* a places result node.
* @return the mozILivemarkInfo object for aNode, if set, null otherwise.
*/
getCachedLivemarkInfo: function PC_getCachedLivemarkInfo(aNode)
this._cachedLivemarkInfoObjects.get(aNode, null)
getCachedLivemarkInfo: function PC_getCachedLivemarkInfo(aNode) {
return this._cachedLivemarkInfoObjects.get(aNode, null);
}
};
/**

Просмотреть файл

@ -19,7 +19,7 @@
Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false),
() => new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false),
{ showDetailsPane: false,
toolbarSet: "back-button, forward-button, organizeButton, clearDownloadsButton, libraryToolbarSpacer, searchFilter" });
]]></script>

Просмотреть файл

@ -712,7 +712,7 @@ var gEditItemOverlay = {
this._folderMenuList.selectedItem = item;
// XXXmano HACK: setTimeout 100, otherwise focus goes back to the
// menulist right away
setTimeout(function(self) self.toggleFolderTreeVisibility(), 100, this);
setTimeout(() => this.toggleFolderTreeVisibility(), 100);
return;
}
@ -906,7 +906,7 @@ var gEditItemOverlay = {
let tags = this._element("tagsField").value;
return tags.trim()
.split(/\s*,\s*/) // Split on commas and remove spaces.
.filter(function (tag) tag.length > 0); // Kill empty tags.
.filter(tag => tag.length > 0); // Kill empty tags.
},
newFolder: Task.async(function* () {

Просмотреть файл

@ -94,6 +94,5 @@ function searchHistory(aInput)
}
window.addEventListener("SidebarFocused",
function()
gSearchBox.focus(),
() => gSearchBox.focus(),
false);

Просмотреть файл

@ -594,7 +594,7 @@ var PlacesOrganizer = {
infoBox.setAttribute("minimal", "true");
infoBox.removeAttribute("wasminimal");
infoBoxExpanderWrapper.hidden =
this._additionalInfoFields.every(function (id)
this._additionalInfoFields.every(id =>
document.getElementById(id).collapsed);
}
additionalInfoBroadcaster.hidden = infoBox.getAttribute("minimal") == "true";
@ -1308,7 +1308,9 @@ var ContentArea = {
options: aOptions || new Object() });
},
get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel),
get currentView() {
return PlacesUIUtils.getViewForNode(this._deck.selectedPanel);
},
set currentView(aNewView) {
let oldView = this.currentView;
if (oldView != aNewView) {
@ -1322,7 +1324,9 @@ var ContentArea = {
return aNewView;
},
get currentPlace() this.currentView.place,
get currentPlace() {
return this.currentView.place;
},
set currentPlace(aQueryString) {
let oldView = this.currentView;
let newView = this.getContentViewForQueryString(aQueryString);
@ -1387,12 +1391,16 @@ var ContentTree = {
this._view = document.getElementById("placeContent");
},
get view() this._view,
get view() {
return this._view;
},
get viewOptions() Object.seal({
showDetailsPane: true,
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
}),
get viewOptions() {
return Object.seal({
showDetailsPane: true,
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
});
},
openSelectedNode: function CT_openSelectedNode(aEvent) {
let view = this.view;

Просмотреть файл

@ -21,7 +21,9 @@ function PlacesTreeView(aFlatList, aOnOpenFlatContainer, aController) {
}
PlacesTreeView.prototype = {
get wrappedJSObject() this,
get wrappedJSObject() {
return this;
},
__xulStore: null,
get _xulStore() {
@ -1067,7 +1069,9 @@ PlacesTreeView.prototype = {
}
},
get result() this._result,
get result() {
return this._result;
},
set result(val) {
if (this._result) {
this._result.removeObserver(this);
@ -1112,9 +1116,15 @@ PlacesTreeView.prototype = {
},
// nsITreeView
get rowCount() this._rows.length,
get selection() this._selection,
set selection(val) this._selection = val,
get rowCount() {
return this._rows.length;
},
get selection() {
return this._selection;
},
set selection(val) {
this._selection = val;
},
getRowProperties: function() { return ""; },
@ -1394,7 +1404,9 @@ PlacesTreeView.prototype = {
return false;
},
getLevel: function(aRow) this._getNodeForRow(aRow).indentLevel,
getLevel: function(aRow) {
return this._getNodeForRow(aRow).indentLevel;
},
getImageSrc: function PTV_getImageSrc(aRow, aColumn) {
// Only the title column has an image.