зеркало из https://github.com/mozilla/pjs.git
Bug 416468 - "Sort by Name" doesn't work for folders directly located under "All Bookmarks" within the Library. r=dietrich.
This commit is contained in:
Родитель
59c66c8b3d
Коммит
d2be33cd80
|
@ -848,9 +848,8 @@ PlacesController.prototype = {
|
|||
* Sort the selected folder by name
|
||||
*/
|
||||
sortFolderByName: function PC_sortFolderByName() {
|
||||
var selectedNode = this._view.selectedNode;
|
||||
var txn = PlacesUtils.ptm.sortFolderByName(selectedNode.itemId,
|
||||
selectedNode.bookmarkIndex);
|
||||
var itemId = PlacesUtils.getConcreteItemId(this._view.selectedNode);
|
||||
var txn = PlacesUtils.ptm.sortFolderByName(itemId);
|
||||
PlacesUtils.ptm.doTransaction(txn);
|
||||
},
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ interface nsITransaction;
|
|||
* the global scope of a js window.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(d91e4575-14cf-497d-b497-bd47b40c50e3)]
|
||||
[scriptable, uuid(7179d28c-bc41-4110-8225-b3ba7e1cb293)]
|
||||
interface nsIPlacesTransactionsService : nsITransactionManager
|
||||
{
|
||||
/**
|
||||
|
@ -315,12 +315,9 @@ interface nsIPlacesTransactionsService : nsITransactionManager
|
|||
*
|
||||
* @param aFolderId
|
||||
* id of the folder to sort
|
||||
* @oaram aFolderIndex
|
||||
* index of the folder to sort
|
||||
* @returns nsITransaction object
|
||||
*/
|
||||
nsITransaction sortFolderByName(in long long aFolderId,
|
||||
in long long aFolderIndex);
|
||||
nsITransaction sortFolderByName(in long long aFolderId);
|
||||
|
||||
/**
|
||||
* Transaction for tagging a URL with the given set of tags. Current tags set
|
||||
|
|
|
@ -157,8 +157,8 @@ placesTransactionsService.prototype = {
|
|||
return new placesEditItemLastModifiedTransaction(aID, aNewLastModified);
|
||||
},
|
||||
|
||||
sortFolderByName: function placesSortFldrByName(aFolderId, aFolderIndex) {
|
||||
return new placesSortFolderByNameTransactions(aFolderId, aFolderIndex);
|
||||
sortFolderByName: function placesSortFldrByName(aFolderId) {
|
||||
return new placesSortFolderByNameTransactions(aFolderId);
|
||||
},
|
||||
|
||||
tagURI: function placesTagURI(aURI, aTags) {
|
||||
|
@ -818,9 +818,8 @@ placesEditItemLastModifiedTransaction.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function placesSortFolderByNameTransactions(aFolderId, aFolderIndex) {
|
||||
function placesSortFolderByNameTransactions(aFolderId) {
|
||||
this._folderId = aFolderId;
|
||||
this._folderIndex = aFolderIndex;
|
||||
this._oldOrder = null,
|
||||
this.redoTransaction = this.doTransaction;
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ function run_test() {
|
|||
do_check_eq(0, bmsvc.getItemIndex(b1));
|
||||
do_check_eq(1, bmsvc.getItemIndex(b2));
|
||||
do_check_eq(2, bmsvc.getItemIndex(b3));
|
||||
var txn17 = ptSvc.sortFolderByName(srtFldId, 1);
|
||||
var txn17 = ptSvc.sortFolderByName(srtFldId);
|
||||
txn17.doTransaction();
|
||||
do_check_eq(2, bmsvc.getItemIndex(b1));
|
||||
do_check_eq(1, bmsvc.getItemIndex(b2));
|
||||
|
|
Загрузка…
Ссылка в новой задаче