ostrio:uiblocker

v1.0.5Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

UI blocker and simple loading spinner for Meteor apps

Inspired by atmospherejs.com

This package simply works after adding into your project, - additional setup isn't required

Installation

meteor add ostrio:uiblocker

Usage

Block screen:

1UIBlock.block()
2UIBlock.block 'some message'

Unblock screen:

1UIBlock.unblock()

Check if screen is blocked:

1if UIBlock.isBlocked
2  # Do something

Meteor.status example:

1Tracker.autorun ->
2  if Meteor.status().connected
3    UIBlock.unblock()
4  else
5    UIBlock.block Meteor.status().status

Meteor.call example:

1UIBlock.block 'Sending email...'
2Meteor.call 'sendEmail', subject, body, (err, res) ->
3  UIBlock.unblock()

Recommended to have main block element right after body tag, which wraps all website content. ID and Class name doesn't make any sense, in example we will use [tw]bootstrap's .container as a wrapper for content.

html
  head
  //- ...

  body
    .container
      //- All content here