Closed Bug 937768 Opened 11 years ago Closed 10 years ago

[Settings] Split up phone_lock.js

Categories

(Firefox OS Graveyard :: Gaia, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: kgrandon, Assigned: kgrandon)

References

Details

Attachments

(2 files)

We should split up the phone_lock.js file so the code for the dialog is separate from the main phone lock panel.
Attached file Github pull request
Attachment #831164 - Attachment description: WIP - Github pull request → Github pull request
Comment on attachment 831164 [details] [review]
Github pull request

Hey Arthur - could you tell me what you think of this one?

I needed a way to pass arguments to panels, and for now data attributes seem to be a fairly sane way to do this. In the future I think I'd like to move to that proposal I emailed you about - but this is probably the best option with the least amount of code changes.

In order to pass arguments around, I changed the currentPanel setter to a changePanel() method which takes a panel id and params object. Right now it's only using dataset on the panel section, but we can change this in the future to be a URL, or object instantiation for example.
Attachment #831164 - Flags: review?(arthur.chen)
Yes, I think we do need a way to pass arguments when changing panels. In addition to a params object, what do you think to have a callback function as the third parameter, so that the navigated panel can bring the results back?
(In reply to Arthur Chen [:arthurcc] from comment #3)
> Yes, I think we do need a way to pass arguments when changing panels. In
> addition to a params object, what do you think to have a callback function
> as the third parameter, so that the navigated panel can bring the results
> back?

I would really rather avoid yet another callback from panel startup. I think passing the arguments into the panel during instantiation is the way to go.
Comment on attachment 831164 [details] [review]
Github pull request

Hi Kevin, sorry for the late review. 

I left some comments regarding the part of passing data to panels. wdyt?
Attachment #831164 - Flags: review?(arthur.chen)
Hi Arthur,

I agree that using data attributes for passing data to panels is rather fragile. I would much rather have something like this which has a defined interface for passing data into a panel. In this case the render method is called whenever the panel is shown, and it can take any necessary data passed into it.

This would be a migration that I would start doing for other panels, and the upcoming work to remove sub-panel dependencies.

I still need to do more testing, but wanted to get some initial feedback on this approach. Thanks!
Attachment #8335125 - Flags: feedback?(arthur.chen)
Comment on attachment 8335125 [details] [review]
Alternative pull request

Evelyn, any ideas?
Attachment #8335125 - Flags: feedback?(ehung)
Comment on attachment 8335125 [details] [review]
Alternative pull request

Seems like we're going with a different approach now.
Attachment #8335125 - Flags: feedback?(ehung)
Attachment #8335125 - Flags: feedback?(arthur.chen)
Keywords: perf
Whiteboard: [c= p=3 s= u=]
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: