Class: Storehouse {#Storehouse}

Provides methods to remove an array of elements from the DOM and inject them back to their original positions.

Demo:

Example

var myStorehouse = new Storehouse();
var elements = $$('div.apple');
myStorehouse.dispose(elements, 'apples');

// later
myStorehouse.inject('apples');

Storehouse Method: dispose {#Storehouse:dispose}

Disposes an array of elements and stores them with the class instance on the specified "shelf". One instance can store multiple shelves.

Syntax:

myStorehouse.dispose(elements, shelf);

Arguments:

  1. elements - (array) An array of elements to be removed from the DOM
  2. shelf = (string) The shelf on which to store your elements in the class

Returns:

This Storehouse instance.

Storehouse Method: inject {#Storehouse:inject}

Replaces the elements to their original positions.

Syntax:

myStorehouse.inject(shelf);

Arguments:

  1. shelf = (string) The shelf storing the elements to inject back into the DOM.