Closed
      
        Bug 1010162
      
      
        Opened 11 years ago
          Closed 11 years ago
      
        
    
  
Follow up 1008144 - Decouple layout logic from app
Categories
(Firefox OS Graveyard :: Gaia::Homescreen, defect)
Tracking
(b2g-v2.0 fixed)
        RESOLVED
        FIXED
        
    
  
        
            2.0 S2 (23may)
        
    
  
| Tracking | Status | |
|---|---|---|
| b2g-v2.0 | --- | fixed | 
People
(Reporter: crdlc, Assigned: crdlc)
References
Details
(Whiteboard: [systemsfe])
Attachments
(1 file)
      No description provided.
|   | Assignee | |
| Updated•11 years ago
           | 
| Comment 1•11 years ago
           | ||
So this is interesting because something everything.me wants to do is to be able to reuse grid logic for smart collections. Perhaps we should design some API so that it can be used in either case (a homescreen grid, or a collection grid).
I'm not sure what the API should look like, but something off the top of my head: 
var grid = new Grid(document.getElementById('folder'));
grid.mixin(Dragdrop);
grid.mixin(EditMode);
grid.mixin(Zoom);
grid.render();
|   | Assignee | |
| Comment 2•11 years ago
           | ||
It sounds good although the goal of this bug was only to remove this
if (!this.stopped) {
  document.body.dataset.cols = layout.perRow;
}
from app.js as you suggested to me in the last review of the bug 1008144 :)
(In reply to Kevin Grandon :kgrandon from comment #1)
> So this is interesting because something everything.me wants to do is to be
> able to reuse grid logic for smart collections. Perhaps we should design
> some API so that it can be used in either case (a homescreen grid, or a
> collection grid).
> 
> I'm not sure what the API should look like, but something off the top of my
> head: 
> 
> var grid = new Grid(document.getElementById('folder'));
> grid.mixin(Dragdrop);
> grid.mixin(EditMode);
> grid.mixin(Zoom);
> grid.render();
|   | Assignee | |
| Comment 3•11 years ago
           | ||
Are you comfortable with this idea?
        Attachment #8422459 -
        Flags: review?(kgrandon)
| Comment 4•11 years ago
           | ||
Comment on attachment 8422459 [details]
Patch v1
Everything seems to work, thanks!
        Attachment #8422459 -
        Flags: review?(kgrandon) → review+
| Comment 5•11 years ago
           | ||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
|   | ||
| Updated•11 years ago
           | 
Whiteboard: [systemsfe]
Target Milestone: --- → 2.0 S2 (23may)
| Comment 6•11 years ago
           | ||
Mass modify - set status-b2g-v2.0 fixed for fixed bugs under vertical homescreen dependency tree.
          status-b2g-v2.0:
          --- → fixed
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•