Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make alert emblems clickable.

  • Loading branch information...
commit b79f9ae45487e6f280b81eff02c6d7d28459d51c 1 parent d392710
@chromakode chromakode authored
View
3  content/siteUrlBarIcon.js
@@ -37,6 +37,9 @@ SocialiteWindow.SiteUrlBarIcon = (function() {
urlBarIcon.className = [this.URLBARICON_CLASS, this.SITE_URLBARICON_CLASS, "urlbar-icon"].join(" ");
urlBarIcon.addEventListener("click", SiteUrlBarIcon.handleClick, false);
+ urlBarIcon.addEventListener("SocialiteEmblemClick", function(e) {
+ Socialite.utils.openUILink(site.inboxURL, e);
+ }, false);
// Hide the icon before we add and position it.
urlBarIcon.setAttribute("hidden", true);
View
17 content/urlBarIcon.xml
@@ -8,7 +8,7 @@
<content>
<xul:stack>
<xul:image anonid="imgSite" xbl:inherits="src,tooltiptext=name"/>
- <xul:image anonid="imgAlert" src="chrome://socialite/skin/alert_emblem.png"/>
+ <xul:image anonid="imgAlert" src="chrome://socialite/skin/alert_emblem.png" onclick="document.getBindingParent(this)._emblemClicked(event);"/>
</xul:stack>
</content>
@@ -54,7 +54,20 @@
this.isWorking = isWorking;
</body>
</method>
-
+
+ <method name="_emblemClicked">
+ <parameter name="originalEvent"/>
+ <body>
+ <![CDATA[
+ originalEvent.stopPropagation();
+
+ var event = document.createEvent("MouseEvents");
+ event.initMouseEvent("SocialiteEmblemClick", true, true, window, 0, 0, 0, 0, 0,
+ false, false, false, false, originalEvent.button, null);
+ this.dispatchEvent(event);
+ ]]>
+ </body>
+ </method>
</implementation>
</binding>
View
3  modules/reddit/reddit.jsm
@@ -33,6 +33,7 @@ RedditSite.prototype.onLoad = function() {
version.api = this.sitePreferences.getCharPref("version.api");
this.newMessages = [];
+ this.inboxURL = this.siteURL + "/message/inbox/";
this.lastNewMessageCount = null;
this.API.init(version);
@@ -581,7 +582,7 @@ RedditSite.prototype.showMessageNotification = function() {
"chrome://socialite/content/reddit/mail_large.png",
null,
RedditNotificationClickHandler,
- this.siteURL + "/message/inbox/"
+ this.inboxURL
);
}
this.lastNewMessageCount = this.newMessages.length;
Please sign in to comment.
Something went wrong with that request. Please try again.