Skip to content

Commit

Permalink
removed complex positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
adardesign committed Oct 11, 2012
1 parent b8b259b commit 45424e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
3 changes: 3 additions & 0 deletions CSS/notify.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.note{

}
27 changes: 0 additions & 27 deletions JS/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
top: 0,
left: 0
},
centerTop: true,
autoFadeOut: true,
fadesAfter: 5000,
fadeInSpeed: 300,
Expand All @@ -28,32 +27,6 @@
}, function() {
sendTofadeOut(100);
});
if(options.centerTop) {
relatedEvent = options.relatedEvent;
options.location.top = relatedEvent.clientY;
options.location.left = relatedEvent.clientX;
jRelatedEvent = $(relatedEvent.target);
thisHeight = notification.outerHeight();
thisWidth = notification.width();
relatedWidth = jRelatedEvent.width();
relatedHeight = jRelatedEvent.height();
options.location.top = options.location.top - (thisHeight + relatedHeight);
options.location.left = options.location.left - (thisWidth / 2);
if(options.location.left + thisWidth > viewPort.x) {
options.location.left = options.location.left - (thisWidth / 2);
}
if(relatedEvent.clientX - (thisWidth / 2) < 0) {
options.location.left = options.location.left + (thisWidth / 2);
}
if(options.location.top < thisHeight) {
options.location.top = options.location.top + (relatedHeight + (thisHeight + 10));
}
} else {
// must supply location object
if(options.location.top === 0) {
//alert("looks like you didnt supply a specific location");
}
}
// add "px" to
options.location.top = options.location.top + "px";
options.location.left = options.location.left + "px";
Expand Down

0 comments on commit 45424e5

Please sign in to comment.