Home

Awesome

reactive-window Build Status

Reactive helpers to work with screen size, etc.

Copyright (c) 2014-2016 Gadi Cohen dragon@wastelands.net, released under the MIT license (see LICENSE.txt).

Usage

To use: meteor add gadicohen:reactive-window in your project folder.

In JavaScript:

All the above functions take an optional operator, and value, e.g:

If you're a stickler per performance, use rwindow.get('screen') etc if you know you won't be performing an op. rwindow._dict.get('screen') works too :)

In Templates:

All the above available as helpers, with the same parameters, e.g.:

Current jQuery(window).width() is {{rwindow.$width}}

and

{{#if rwindow.screen 'lte' 'medium'}}
  {{> xsmallSmallMediumLayout}}
{{else}}
  {{> largeLayout}}
{{/if}}

Operator reference