fix for bug #383681: While BM is in a sorted view, adding a new separator is added below the position index, not the bookmark.

disable the "insert separator" from a sorted view and from views that are excluding items.

patch=Christine Yen <cyen@mozilla.com>

r=sspitzer
This commit is contained in:
sspitzer@mozilla.org 2007-06-18 21:19:39 -07:00
parent 4a0f8f84bf
commit d4db964d77
3 changed files with 9 additions and 2 deletions

View File

@ -170,7 +170,10 @@ PlacesController.prototype = {
case "placesCmd_new:separator":
return this._canInsert() &&
this._view.peerDropTypes
.indexOf(PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) != -1;
.indexOf(PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) != -1 &&
!asQuery(this._view.getResult().root).queryOptions.excludeItems &&
this._view.getResult().sortingMode ==
Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
case "placesCmd_show:info":
if (this._view.hasSingleSelection) {
var selectedNode = this._view.selectedNode;

View File

@ -63,7 +63,7 @@
<commandset id="placesCommands"
commandupdater="true"
events="focus"
events="focus,sort"
oncommandupdate="goUpdatePlacesCommands();">
<command id="placesCmd_open"
oncommand="goDoCommand('placesCmd_open');"/>

View File

@ -292,5 +292,9 @@ var OptionsFilter = {
var options = queryNode.queryOptions.clone();
options.sortingMode = result.sortingMode;
this.getHandler(queries).value = options;
// Makes sure that changes to the view triggers the updating of
// the commandset placesCommands
window.document.commandDispatcher.updateCommands("sort");
}
};