How to use ember-responsive - 3 common examples

To help you get started, we’ve selected a few ember-responsive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github offirgolan / ember-light-table / tests / helpers / responsive.js View on Github external
// jscs: disable
import { A } from '@ember/array';
import { classify } from '@ember/string';
import { computed } from '@ember/object';
import { getOwner } from '@ember/application';
import { registerAsyncHelper } from '@ember/test';
import MediaService from 'ember-responsive/media';

MediaService.reopen({
  // Change this if you want a different default breakpoint in tests.
  _defaultBreakpoint: 'desktop',

  _breakpointArr: computed('breakpoints', function() {
    return Object.keys(this.get('breakpoints')) || A([]);
  }),

  _forceSetBreakpoint(breakpoint) {
    let found = false;

    const props = {};
    this.get('_breakpointArr').forEach(function(bp) {
      const val = bp === breakpoint;
      if (val) {
        found = true;
      }
github ember-learn / ember-help-wanted / tests / helpers / responsive.js View on Github external
import MediaService from 'ember-responsive/media';

import { getOwner } from '@ember/application';
import { computed } from '@ember/object';
import { A } from '@ember/array';
import { classify } from '@ember/string';
import { registerAsyncHelper } from '@ember/test';

MediaService.reopen({
  // Change this if you want a different default breakpoint in tests.
  _defaultBreakpoint: 'desktop',

  _breakpointArr: computed('breakpoints', function() {
    return Object.keys(this.get('breakpoints')) || A([]);
  }),

  _forceSetBreakpoint(breakpoint) {
    let found = false;

    const props = {};
    this.get('_breakpointArr').forEach(function(bp) {
      const val = bp === breakpoint;
      if (val) {
        found = true;
      }
github ilios / frontend / tests / helpers / responsive.js View on Github external
import { registerAsyncHelper } from '@ember/test';
import { A } from '@ember/array';
import { computed } from '@ember/object';
import { classify } from '@ember/string';
import { getOwner } from '@ember/application';
import MediaService from 'ember-responsive/media';

MediaService.reopen({
  // Change this if you want a different default breakpoint in tests.
  _defaultBreakpoint: 'desktop',

  _breakpointArr: computed('breakpoints', function() {
    return Object.keys(this.get('breakpoints')) || A([]);
  }),

  _forceSetBreakpoint(breakpoint) {
    let found = false;

    const props = {};
    this.get('_breakpointArr').forEach(function(bp) {
      const val = bp === breakpoint;
      if (val) {
        found = true;
      }

ember-responsive

An ember-cli addon that gives you a simple, Ember-aware way of dealing with media queries.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular ember-responsive functions