You are here

function layout_breakpoint_sort_by_width in Layout 7

Sort the breakpoints in ascending order by their width.

1 string reference to 'layout_breakpoint_sort_by_width'
layout_breakpoint_load_all in ./layout.module
API function to get all responsive breakpoint on the site.

File

./layout.module, line 323
Responsive layout builder tool for Panels.

Code

function layout_breakpoint_sort_by_width($a, $b) {

  // Cast the width to int. Whether it provided as px or em, the cast should
  // result in a relevant number. It will not sort mixed em/px numbers properly
  // but that sounds like a broken setup. Not desigining for that.
  if ((int) $a->width == (int) $b->width) {
    return 0;
  }
  return (int) $a->width < (int) $b->width ? -1 : 1;
}