Add signals and attributes for datagrid mobile mode

Review Request #8132 — Created April 27, 2016 and submitted

Information

Djblets
release-0.9.x
9916c48...

Reviewers

Datagrids now represent their current mobile state through the
data-datagrid-mobile-mode attribute. When the datagrid changes modes,
it will update that attribute and fire the mobileModeToggle signal with
an object that indicates wether it was enabled or disabled.

Tested this with an upcoming change in Splat.

Description From Last Updated

I think we should probably switch these, so a caller can always know what mode it's in by consulting the …

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/js/datagrid.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/js/datagrid.js
    
    
  2. 
      
brennie
brennie
chipx86
  1. 
      
  2. djblets/static/djblets/js/datagrid.js (Diff revision 1)
     
     
     
    Show all issues

    I think we should probably switch these, so a caller can always know what mode it's in by consulting the attribute, if needed (something deeper into the callback handler that may not have the parameter passed).

    I'm also thinking we shouldn't refer to this as the "mobile" mode, because we may want other views down the road. So instead, how about datagrid-display-mode={mobile,desktop} for the attribute, and datagridDisplayModeChanged for the event?

    (The prefix on the event keeps it namespaced so there's never any risk of collisions on the element, slim though they may be.)

  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/js/datagrid.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/js/datagrid.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.9.x (b9dccbf)