isScreenNarrow - how best to modify max-width?

Hi Enyo Folks,
I'm working on a project that relies on isScreenNarrow() to switch to showing only 1 panel at a time in a collapsingArranger. It works great, except that I only want that behavior at max-width: 540px. I can alter the 2.7 lib/layout like so:

// Enyo 2.7
//==============================
// lib/layout/src/Panels/Panels.js - line 851:
//==============================
isScreenNarrow: function () {
  if(Panels.isNarrowDevice()) {
    return true;
  } else {
    return dom.getWindowWidth() <= 540; /* <<< Change value from 800 to 540 */
  }
},
  
// and //
//==============================
// lib/layout/src/Panels/Panels.css - line 7:
//==============================
@media all and (max-width: 540px) { /* <<< Change value from 800px to 540px */
  .enyo-panels-fit-narrow > * {
    min-width: 100%;
    max-width: 100%;
  }
}
//================================
But this makes me feel dirty and seems it would entail maintaining a fork and I don't even know how that would work with enyo-dev...
Is there a better way to modify this behavior?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!