Skip to content

Commit 0000f8e

Browse files
committed
IE fix. Changed how breakpoint is applied to document.
1 parent 12e99b9 commit 0000f8e

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 4.6.4
2+
3+
* IE8 fix
4+
* Setting breakpoint on document no longer finds children images
5+
16
# 4.6.3
27

38
* Fixed broken qunit testing

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "breakpoint",
3-
"version": "4.6.3",
3+
"version": "4.6.4",
44
"description": "Breakpoint is a column based media query generator and responsive image framework.",
55
"author": "Les James",
66
"homepage": "https://github.com/lesjames/breakpoint",

jquery.breakpoint.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Breakpoint plugin v4.6.2
2+
* jQuery Breakpoint plugin v4.6.4
33
* http://github.com/lesjames/breakpoint
44
*
55
* MIT License
@@ -47,7 +47,7 @@
4747
} else {
4848

4949
// older browsers need some help
50-
window.getComputedStyle = function(el) {
50+
var getComputedFallback = function(el) {
5151
this.el = el;
5252
this.getPropertyValue = function(prop) {
5353
var re = /(\-([a-z]){1})/g;
@@ -62,8 +62,8 @@
6262
};
6363

6464
// fallback label is added as a font-family to the head, thanks Jeremy Keith
65-
style = window.getComputedStyle(document.getElementsByTagName('head')[0], '');
66-
style = removeQuotes(style.getPropertyValue('font-family'));
65+
style = getComputedFallback(document.getElementsByTagName('head')[0]);
66+
style = style.getPropertyValue('font-family');
6767

6868
}
6969

@@ -218,8 +218,12 @@
218218

219219
$.fn.breakpoint = function (options, callback) {
220220

221-
// reduce selection to only images
222-
var $images = this.find('img').add( this.filter('img') );
221+
var $images = [];
222+
223+
if (this[0] !== document) {
224+
// reduce selection to only images
225+
$images = this.find('img').add( this.filter('img') );
226+
}
223227

224228
// create an instance and pass it selected images
225229
var breakpointImages = new BreakpointImages( $images );

0 commit comments

Comments
 (0)