ember-responsive
Advanced tools
Comparing version 0.2.8 to 0.2.9
{ | ||
"name": "ember-responsive", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "Jonathan Geiger <geiger@freshbooks.com>", |
@@ -148,16 +148,6 @@ (function(Ember) { | ||
var listener = function(matcher) { | ||
// Make sure that set(name, matcher) and notifyPropertyChange(name) notifications | ||
// are merged so only one notification is sent, | ||
// even the first time this listener is called | ||
_this.beginPropertyChanges(); | ||
function listener(matcher) { | ||
_this.set(name, matcher); | ||
_this.notifyPropertyChange(name); | ||
_this.set(isser, matcher.matches); | ||
_this.endPropertyChanges(); | ||
if (matcher.matches) { | ||
@@ -168,5 +158,10 @@ _this.get('matches').add(name); | ||
} | ||
}; | ||
} | ||
this.get('listeners')[name] = listener; | ||
matcher.addListener(listener); | ||
if (matcher.addListener) { | ||
matcher.addListener(function(matcher){ | ||
Ember.run(null, listener, matcher); | ||
}); | ||
} | ||
listener(matcher); | ||
@@ -173,0 +168,0 @@ } |
{ | ||
"name": "ember-responsive", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "Easy responsive layouts with Ember", | ||
@@ -29,3 +29,3 @@ "scripts": { | ||
}, | ||
"homepage": "https://github.com/freshbooks/ember-responsive", | ||
"homepage": "https://freshbooks.github.io/ember-responsive/", | ||
"devDependencies": { | ||
@@ -32,0 +32,0 @@ "testem": "^0.6.14", |
@@ -48,3 +48,3 @@ module('Ember.Responsive.Media'); | ||
test('matcher\'s name property can be bound to', function() { | ||
test('matcher\'s isser property notifies upon change', function() { | ||
var listener, matcher, name = 'somethingUnique', | ||
@@ -54,3 +54,3 @@ subject = Ember.Responsive.Media.create(), | ||
subject.addObserver(name, this, observer); | ||
subject.addObserver('is'+name.classify(), this, observer); | ||
//First call | ||
@@ -61,3 +61,3 @@ subject.match(name, 'query'); | ||
matcher = subject.get(name); | ||
matcher = {}; // Dummy MediaQueryList | ||
matcher.matches = true; | ||
@@ -71,3 +71,6 @@ //Second call | ||
ok(observer.callCount == 3); | ||
ok( | ||
observer.callCount == 3, | ||
'Expected 3 calls to an observer, '+observer.callCount+' were called instead' | ||
); | ||
}); |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2394
0
203588