Bug 876926 - Fix placement id error, and accidental advantage had in toolbar.xml, r=jaws

This commit is contained in:
Gijs Kruitbosch 2013-08-30 08:55:39 +02:00
parent 57aa58568b
commit 0d3a8e9772
3 changed files with 7 additions and 4 deletions

View File

@ -174,6 +174,7 @@
let newIds = [id for (id of newVal) if (oldIds.indexOf(id) == -1)];
CustomizableUI.beginBatchUpdate();
for (let newId of newIds) {
oldIds = CustomizableUI.getWidgetIdsInArea(this.id);
let nextId = newId;
let pos;
do {

View File

@ -1431,7 +1431,7 @@ let CustomizableUIInternal = {
for (let listener of gListeners) {
try {
if (aEvent in listener) {
if (typeof listener[aEvent] == "function") {
listener[aEvent].apply(listener, aArgs);
}
} catch (e) {
@ -1960,7 +1960,8 @@ this.CustomizableUI = {
throw new Error("Area not yet restored");
}
return gPlacements.get(aArea);
// We need to clone this, as we don't want to let consumers muck with placements
return [].concat(gPlacements.get(aArea));
},
getWidgetsInArea: function(aArea) {
return this.getWidgetIdsInArea(aArea).map(

View File

@ -777,8 +777,9 @@ CustomizeMode.prototype = {
aEvent.dataTransfer.mozGetDataAt(kDragDataTypePrefix + documentId, 0);
let draggedWrapper = document.getElementById("wrapper-" + draggedItemId);
let originArea = this._getCustomizableParent(draggedWrapper);
if (this._dragWidthMap)
this._dragWidthMap.clear()
if (this._dragWidthMap) {
this._dragWidthMap.clear();
}
// Do nothing if the target area or origin area are not customizable.
if (!targetArea || !originArea) {
return;