Skip to content

Commit

Permalink
Merge pull request #5 from loveky/bug/fix-2
Browse files Browse the repository at this point in the history
(fix) make modal background not clickable [Fixes #2]
  • Loading branch information
jimobrien committed Sep 14, 2014
2 parents 28ba075 + c6328ca commit 407a3e2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
18 changes: 13 additions & 5 deletions dist/angular-morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@
},
fade: function (element) {
element.css({
'visibility': 'visible',
'opacity': '1'
'display': 'block'
});
setTimeout(function() {
element.css({
'opacity': '1'
});
}, 25);
}
};

Expand Down Expand Up @@ -122,6 +126,11 @@
element.css({
'opacity': '0'
});
setTimeout(function() {
element.css({
'display': 'none'
});
}, 525);
}
};

Expand Down Expand Up @@ -484,7 +493,7 @@
'outline': 'none',
},
fade: {
'visibility': 'hidden',
'display': 'none',
'opacity': '0',
'position': 'fixed',
'top': '0',
Expand All @@ -494,8 +503,7 @@
'height': '100%',
'background': 'rgba(0,0,0,0.5)',
'-webkit-transition': 'opacity 0.5s',
'transition': 'opacity 0.5s',
'pointer-events': 'none'
'transition': 'opacity 0.5s'
}

};
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-morph.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/transitions/modalSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Modal Transition', function(){
});

waitsFor(function() {
return getComputedStyle(morphable.find("div")[0], null).visibility === "visible";
return getComputedStyle(morphable.find("div")[0], null).opacity === "1";
}, "wrapper should be visible to user", 35);

runs(function() {
Expand Down
5 changes: 2 additions & 3 deletions src/morphAssist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'outline': 'none',
},
fade: {
'visibility': 'hidden',
'display': 'none',
'opacity': '0',
'position': 'fixed',
'top': '0',
Expand All @@ -34,8 +34,7 @@
'height': '100%',
'background': 'rgba(0,0,0,0.5)',
'-webkit-transition': 'opacity 0.5s',
'transition': 'opacity 0.5s',
'pointer-events': 'none'
'transition': 'opacity 0.5s'
}

};
Expand Down
13 changes: 11 additions & 2 deletions src/transitions/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@
},
fade: function (element) {
element.css({
'visibility': 'visible',
'opacity': '1'
'display': 'block'
});
setTimeout(function() {
element.css({
'opacity': '1'
});
}, 25);
}
};

Expand Down Expand Up @@ -111,6 +115,11 @@
element.css({
'opacity': '0'
});
setTimeout(function() {
element.css({
'display': 'none'
});
}, 525);
}
};

Expand Down

0 comments on commit 407a3e2

Please sign in to comment.