mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 984900 - Places async transactions: Implement 'sort by name' ui command. r=mak
This commit is contained in:
parent
c66bf31141
commit
c77ef63e3a
@ -139,7 +139,6 @@ PlacesController.prototype = {
|
||||
case "placesCmd_new:folder":
|
||||
case "placesCmd_new:livemark":
|
||||
case "placesCmd_new:bookmark":
|
||||
case "placesCmd_sortBy:name":
|
||||
case "placesCmd_createBookmark":
|
||||
return false;
|
||||
}
|
||||
@ -297,7 +296,7 @@ PlacesController.prototype = {
|
||||
this.reloadSelectedLivemark();
|
||||
break;
|
||||
case "placesCmd_sortBy:name":
|
||||
this.sortFolderByName();
|
||||
this.sortFolderByName().then(null, Cu.reportError);
|
||||
break;
|
||||
case "placesCmd_createBookmark":
|
||||
let node = this._view.selectedNode;
|
||||
@ -781,7 +780,7 @@ PlacesController.prototype = {
|
||||
throw Cr.NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
if (!PlacesUIUtils.useAsyncTransactions) {
|
||||
var txn = new PlacesCreateSeparatorTransaction(ip.itemId, ip.index);
|
||||
let txn = new PlacesCreateSeparatorTransaction(ip.itemId, ip.index);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
// Select the new item.
|
||||
let insertedNodeId = PlacesUtils.bookmarks
|
||||
@ -810,11 +809,16 @@ PlacesController.prototype = {
|
||||
/**
|
||||
* Sort the selected folder by name
|
||||
*/
|
||||
sortFolderByName: function PC_sortFolderByName() {
|
||||
var itemId = PlacesUtils.getConcreteItemId(this._view.selectedNode);
|
||||
var txn = new PlacesSortFolderByNameTransaction(itemId);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
},
|
||||
sortFolderByName: Task.async(function* () {
|
||||
let itemId = PlacesUtils.getConcreteItemId(this._view.selectedNode);
|
||||
if (!PlacesUIUtils.useAsyncTransactions) {
|
||||
var txn = new PlacesSortFolderByNameTransaction(itemId);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
return;
|
||||
}
|
||||
let guid = yield PlacesUtils.promiseItemGUID(itemId);
|
||||
yield PlacesTransactions.transact(PlacesTransactions.SortByName(guid));
|
||||
}),
|
||||
|
||||
/**
|
||||
* Walk the list of folders we're removing in this delete operation, and
|
||||
|
Loading…
Reference in New Issue
Block a user