Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a minor problem with notifications.

  • Loading branch information...
commit 3fcd527f045a9452299e895192d186cf03b9f0ee 1 parent b7d605d
@rgarg8 rgarg8 authored
Showing with 22 additions and 17 deletions.
  1. +22 −17 chrome/content/groove-shredder.js
View
39 chrome/content/groove-shredder.js
@@ -681,25 +681,30 @@ orgArgeeCodeGrooveShredder.utility =
</li>\
';
// Is a notification area available?
- if(theApp.$("ul#notifications",
- theApp.browser.contentDocument)
- .length == 0){
+ if(typeof theApp.browser !== "undefined"){
+ if(theApp.$("ul#notifications",
+ theApp.browser.contentDocument)
+ .length == 0){
+ // No place to put notification. Fallback to alert.
+ alert(pre+theApp.localize.getString(stringName)+post);
+ } else {
+ // Attach the blank notification to the page
+ theApp.$("ul#notifications",theApp.browser.contentDocument)
+ .prepend(notification);
+ // Insert magical text into the notification
+ theApp.$("li.shredded:first",theApp.browser.contentDocument).find('p')
+ .text(pre+theApp.localize.getString(stringName)+post);
+ // Slide the notification up, wait, then slide out
+ theApp.$("li.shredded:first",theApp.browser.contentDocument)
+ .animate({top: '0px'}, 300, "linear")
+ .delay(6000)
+ .animate({top: '100px'}, {"duration": 300, "complete":function(){
+ theApp.$(this).remove();
+ }});
+ }
+ } else {
// No place to put notification. Fallback to alert.
alert(pre+theApp.localize.getString(stringName)+post);
- } else {
- // Attach the blank notification to the page
- theApp.$("ul#notifications",theApp.browser.contentDocument)
- .prepend(notification);
- // Insert magical text into the notification
- theApp.$("li.shredded:first",theApp.browser.contentDocument).find('p')
- .text(pre+theApp.localize.getString(stringName)+post);
- // Slide the notification up, wait, then slide out
- theApp.$("li.shredded:first",theApp.browser.contentDocument)
- .animate({top: '0px'}, 300, "linear")
- .delay(6000)
- .animate({top: '100px'}, {"duration": 300, "complete":function(){
- theApp.$(this).remove();
- }});
}
},
theApp : orgArgeeCodeGrooveShredder
Please sign in to comment.
Something went wrong with that request. Please try again.