Closed
Bug 612016
Opened 14 years ago
Closed 14 years ago
Switch to construct/destroy model for context-menu
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
1.0b1
People
(Reporter: adw, Assigned: adw)
References
Details
Attachments
(1 file)
27.54 KB,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
See bug 596053.
Assignee | ||
Comment 1•14 years ago
|
||
When an item is created, it's added to the top-level context menu. If the item is later added to a Menu (by being a member of the items array of the options object passed to the Menu constructor), the item is removed from the top-level context menu and added to the new submenu. (This results in some unnecessary shuffling of XUL elements, but I don't see a way around that.) Calling destroy on a non-top-level item is a no-op. In other words, if an item is contained in a Menu, calling destroy on it doesn't remove it from the Menu. (I'm OK with this for now; certainly we can come back later if we decide we want sub-items to be destroyable.) destroy is idempotent: all calls to destroy after the first are no-ops. This patch also updates the test, doc, and Programs page in the dev-guide.
Attachment #490423 -
Flags: review?(myk)
Assignee | ||
Comment 2•14 years ago
|
||
(In reply to comment #1) > Calling destroy on a non-top-level item is a no-op. In other words, if an item > is contained in a Menu, calling destroy on it doesn't remove it from the Menu. > (I'm OK with this for now; certainly we can come back later if we decide we > want sub-items to be destroyable.) Oh, I meant to add that it's not currently possible to remove() a sub-item anyway.
Comment 3•14 years ago
|
||
Comment on attachment 490423 [details] [diff] [review] patch >-// ADD NO TESTS BELOW THIS LINE! /////////////////////////////////////////////// >+// NO TESTS BELOW THIS LINE! /////////////////////////////////////////////////// Ha! :-)
Attachment #490423 -
Flags: review?(myk) → review+
Assignee | ||
Comment 4•14 years ago
|
||
Completely screwed up the merges here. https://github.com/mozilla/addon-sdk/commit/0c5622438b02b2f7ad4ff7c2454462cd43912cea https://github.com/mozilla/addon-sdk/commit/b6a233af15694fb010d1283d4495ef789d0c3c80
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: -- → 0.10
Updated•13 years ago
|
Target Milestone: 0.10 → 1.0b1
You need to log in
before you can comment on or make changes to this bug.
Description
•