Skip to content

Commit de05577

Browse files
committed
Merge pull request briangonzalez#20 from lucanos/master
Adjusted Order of Precedence for Parent
2 parents cfe1ec0 + 5bff735 commit de05577

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dist/jquery.adaptive-backgrounds.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.adaptive-backgrounds.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@
6969
var $data = data;
7070
var $parent;
7171

72-
if ( useCSSBackground() ){
73-
$parent = $this;
72+
if ( opts.parent && $this.parents( opts.parent ).length ) {
73+
$parent = $this.parents( opts.parent );
7474
}
75-
else if ( $this.attr( DATA_PARENT ) ){
75+
else if ( $this.attr( DATA_PARENT ) && $this.parents( $this.attr( DATA_PARENT ) ).length ){
7676
$parent = $this.parents( $this.attr( DATA_PARENT ) );
7777
}
78-
else if (opts.parent) {
79-
$parent = $this.parents( opts.parent );
78+
else if ( useCSSBackground() ){
79+
$parent = $this;
8080
}
8181
else {
8282
$parent = $this.parent();

0 commit comments

Comments
 (0)