ember-responsive
Advanced tools
Comparing version 0.2.9 to 0.2.10
{ | ||
"name": "ember-responsive", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "Jonathan Geiger <geiger@freshbooks.com>", |
@@ -5,4 +5,4 @@ { | ||
"description": "Easy responsive layouts with Ember", | ||
"version": "0.2.7", | ||
"url": "https://github.com/freshbooks/ember-responsive" | ||
"version": "0.2.8", | ||
"url": "https://freshbooks.github.io/ember-responsive/" | ||
}, | ||
@@ -209,3 +209,3 @@ "files": { | ||
"file": "lib/media.js", | ||
"line": 120, | ||
"line": 121, | ||
"description": "Adds a new matcher to the list.\n\nAfter this method is called, you will be able to access the result\nof the matcher as a property on this object.\n\n**Adding a new matcher**\n\n```javascript\nmedia = Ember.Responsive.Media.create();\nmedia.match('all', 'all');\nmedia.get('all');\n // => instanceof window.matchMedia\nmedia.get('all.matches');\n // => true\n```", | ||
@@ -212,0 +212,0 @@ "params": [ |
@@ -295,4 +295,5 @@ (function(Ember) { | ||
classNames: function() { | ||
var dasherize = Ember.String.dasherize; | ||
return this.get('matches').map(function(name) { | ||
return 'media-' + name.dasherize(); | ||
return 'media-' + dasherize(name); | ||
}).join(' '); | ||
@@ -323,20 +324,11 @@ }.property('matches.[]'), | ||
match: function(name, query) { | ||
var matcher = this.get('mql')(query), | ||
isser = 'is' + name.classify(), | ||
var classify = Ember.String.classify, | ||
matcher = this.get('mql')(query), | ||
isser = 'is' + classify(name), | ||
_this = this; | ||
var listener = function(matcher) { | ||
// Make sure than 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) { | ||
@@ -347,5 +339,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); | ||
@@ -352,0 +349,0 @@ } |
{ | ||
"name": "ember-responsive", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"description": "Easy responsive layouts with Ember", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
203330