Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes: Fix memory leak from JQuery's click callback

  • Loading branch information...
commit 6eccdd71658b6fe425072d80cefe6e1744c5ffc4 1 parent 5a86f30
Mohammad Anwari authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 system/menu.js
View
10 system/menu.js
@@ -1,3 +1,5 @@
+
+var userAccountIsSetup = false;
var UserAccount = UserAccount || (function() {
return {
getIconFile: function() { return "user-icon.png" },
@@ -474,14 +476,20 @@ var menu = (function() {
}
var setupUserAccount = function() {
+
var e = $("#userAccount");
e.css("bottom", "0px");
e.find("img").attr("src", userAccount.getIconFile());
e.find("h1").text(userAccount.getRealName());
e.find("span").text(userAccount.getHostName());
- e.click(function() {
+
+ if (userAccountIsSetup)
+ return;
+
+ e.on("click", function() {
Utils.run_desktop("/usr/share/applications/gnome-user-accounts-panel.desktop");
});
+ userAccountIsSetup = true;
}
var linkHandleTapHold = function(e, target) {
Please sign in to comment.
Something went wrong with that request. Please try again.