boomqueries
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -1,2 +0,2 @@ | ||
/*! BoomQueries 0.2.0 | http://boomtownroi.github.io/boomqueries/ | (c) 2014 BoomTown | MIT License */ | ||
/*! BoomQueries 0.3.0 | http://boomtownroi.github.io/boomqueries/ | (c) 2015 BoomTown | MIT License */ | ||
(function(root, factory) { | ||
@@ -128,4 +128,4 @@ if (typeof define === 'function' && define.amd) { | ||
if (typeof options !== 'undefined') details.detail = options; | ||
var updateEvent = new CustomEvent('checkyourself', details); | ||
// Loop through our nodes firing a 'checkyourself' event on each of them | ||
var updateEvent = new CustomEvent('boomQueries_checkYourself', details); | ||
// Loop through our nodes firing a 'boomQueries_checkYourself' event on each of them | ||
nodes.forEach(function(node) { | ||
@@ -153,3 +153,3 @@ node.dispatchEvent(updateEvent); | ||
// Attach an event listener with functionality to update it's own class | ||
node.addEventListener('checkyourself', function(event) { | ||
node.addEventListener('boomQueries_checkYourself', function(event) { | ||
// event.detail is custom object if we have one | ||
@@ -181,3 +181,3 @@ | ||
}; | ||
var completedEvent = new CustomEvent('nodeUpdated', details); | ||
var completedEvent = new CustomEvent('boomQueries_nodeUpdated', details); | ||
@@ -189,3 +189,3 @@ // You can now attach an event listener to this node to catch when we have completed the event | ||
node.addEventListener('cleanup', function(event) { | ||
node.addEventListener('boomQueries_cleanup', function(event) { | ||
var self = this; | ||
@@ -252,5 +252,5 @@ this.breaks.forEach(function(br) { | ||
// Remove event listener before discarding to avoid zombies | ||
nodes[i].dispatchEvent(new CustomEvent('cleanup')); | ||
nodes[i].removeEventListener('checkyourself'); | ||
nodes[i].removeEventListener('cleanup'); | ||
nodes[i].dispatchEvent(new CustomEvent('boomQueries_cleanup')); | ||
nodes[i].removeEventListener('boomQueries_checkYourself'); | ||
nodes[i].removeEventListener('boomQueries_cleanup'); | ||
nodes.splice(i, 1); | ||
@@ -257,0 +257,0 @@ return true; |
@@ -0,0 +0,0 @@ Copyright (c) BoomTown |
@@ -5,3 +5,3 @@ { | ||
"description": "BoomQueries is our take on element queries; sizing elements based on their container.", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "boomqueries", |
@@ -106,3 +106,3 @@ # <img src="dist/images/logo-boomqueries.png" width="50px;"> BoomQueries | ||
component.addEventListener('nodeUpdated', function(event){ | ||
component.addEventListener('boomQueries_nodeUpdated', function(event){ | ||
console.log(event.detail); | ||
@@ -142,4 +142,4 @@ }); | ||
boomQueries.add(".component", [ | ||
[480, "component--md"], | ||
[600, "component--lg"] | ||
[480, "component--md"], | ||
[600, "component--lg"] | ||
]); | ||
@@ -188,2 +188,2 @@ | ||
Copyright 2014 [BoomTown](http://boomtownroi.com) under the [MIT License](https://github.com/BoomTownROI/boomqueries/blob/master/LICENSE.md) | ||
Copyright 2015 [BoomTown](http://boomtownroi.com) under the [MIT License](https://github.com/BoomTownROI/boomqueries/blob/master/LICENSE.md) |
18025