Closed
Bug 909729
Opened 12 years ago
Closed 12 years ago
Dragging bookmark items to navbar results in dis-functioning bookmark items
Categories
(Firefox :: Toolbars and Customization, defect)
Firefox
Toolbars and Customization
Tracking
()
RESOLVED
FIXED
Firefox 28
People
(Reporter: mikedeboer, Assigned: Gijs)
References
Details
(Whiteboard: [Australis:M9][Australis:P2])
Attachments
(1 file, 1 obsolete file)
2.75 KB,
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
STR:
1. Open Customization mode
2. Drag the toolbar items from the bookmarks toolbar to the navbar
3. Exit Customization mode
4. Click on a Bookmarks (smart) folder
Expected result:
The folder panels open, showing the bookmark items within
Actual result:
No folder panel opens.
Warning shown in the console:
JavaScript strict warning: chrome://browser/content/browser.xul, line 1: reference to undefined property this._placesView
Reporter | ||
Comment 1•12 years ago
|
||
Marco, do you think this is related to bug 895938 at all and if a similar solution would be appropriate?
Flags: needinfo?(mak77)
Comment 2•12 years ago
|
||
I don't think it's related explicitly to the change, could just be a missing piece of code handgling a special case. The code to touch is very likely the same.
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Flags: needinfo?(mak77)
Assignee | ||
Comment 3•12 years ago
|
||
This is essentially the same as bug 890567, which shouldn't have been duped to bug 895938.
Assignee | ||
Comment 5•12 years ago
|
||
I looked at this briefly. It's because the navbar's customization target isn't a toolbar. Detecting that it is seemed a bit tricky to me... I've added code that just walks the parentNode chain, which will work assuming people don't do really weird things like adding toolbars with a customizationTarget that's not a descendant of that toolbar... This also fixes bug 901418. Marco, does this look OK to you?
Attachment #807132 -
Flags: review?(mak77)
Comment 6•12 years ago
|
||
Comment on attachment 807132 [details] [diff] [review]
bookmark toolbar items don't work in the navbar,
Review of attachment 807132 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/browser-places.js
@@ +964,5 @@
> // there is no need to initialize the toolbar if customizing because
> // init() will be called when the customization is done. Finally the view
> // is hidden if the element is not on a toolbar.
> + let container = viewElt.parentNode.parentNode;
> + if (!this._isInToolbar(container) || container.collapsed ||
thanks for looking into this.
Are you sure the container.collapsed works? it worked cause we set collapsed on toolbars, I don't think we set it on the customization target...
This also doesn't seem to cover the second part of the comment, that is "skip initialization during customization mode")
You may want something like let toolbar = this._getParentToolbar(viewElt); that returns either the toolbar or null, though you also need to add an additional check for whether we are in customization mode.
Attachment #807132 -
Flags: review?(mak77)
Assignee | ||
Comment 7•12 years ago
|
||
That makes sense. Updated to look for the toolbar recursively instead. Note that the ._isCustomizing check was still there in the original patch. I now moved it about to make the if condition shorter.
Attachment #807705 -
Flags: review?(mak77)
Assignee | ||
Updated•12 years ago
|
Attachment #807132 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Assignee: mak77 → gijskruitbosch+bugs
Comment 8•12 years ago
|
||
Comment on attachment 807705 [details] [diff] [review]
bookmark toolbar items don't work in the navbar,
Review of attachment 807705 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/browser-places.js
@@ +963,5 @@
> + // - not in a toolbar, or;
> + // - the toolbar is collapsed, or;
> + // - the toolbar is hidden some other way:
> + // don't initialize. Also, there is no need to initialize the toolbar if
> + // customizing because this will happen when the customization is done.
comma after customizing and s/this/that/?
@@ +964,5 @@
> + // - the toolbar is collapsed, or;
> + // - the toolbar is hidden some other way:
> + // don't initialize. Also, there is no need to initialize the toolbar if
> + // customizing because this will happen when the customization is done.
> + let toolbar = this._getParentToolbar(viewElt.parentNode.parentNode);
may simplify by not providing .parentNode.parentNode, the only added cost is checking a couple localName, shouldn't matter.
Oh, I missed the _isCustomizing check in the middle of splinter, sorry
@@ +996,5 @@
> PlacesCommandHook.showPlacesOrganizer("BookmarksToolbar");
> }
> + },
> +
> + _getParentToolbar: function(node) {
since in Places we have 2 concept of nodes (dom nodes and places nodes) please use element or elt here
Attachment #807705 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 9•12 years ago
|
||
Landed with nits fixed: https://hg.mozilla.org/projects/ux/rev/8d12999288a9
Flags: needinfo?(mak77)
Whiteboard: [Australis:M9][Australis:P2] → [Australis:M9][Australis:P2][fixed-in-ux]
Assignee | ||
Comment 10•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:M9][Australis:P2][fixed-in-ux] → [Australis:M9][Australis:P2]
Target Milestone: --- → Firefox 28
You need to log in
before you can comment on or make changes to this bug.
Description
•