Remove /unsubscribe from htaccess config
[blerg.git] / www / jssrc / blerg / Link.js
index 929e1a5..d4b9aec 100644 (file)
@@ -1,5 +1,27 @@
 enyo.kind({
-       name: "blerg.Link",
-       tag: "a",
-       attributes: {href:"#"}
+    name: "blerg.Link",
+    kind: "Control",
+    tag: "a",
+    published: {
+        href: "#",
+    },
+    handlers: {
+        onclick: "muteLink",
+    },
+    create: function() {
+        this.inherited(arguments);
+        this.hrefChanged();
+    },
+    hrefChanged: function() {
+        this.setAttribute('href', this.href);
+    },
+    muteLink: function(inSender, inEvent) {
+        if (inEvent.which > 1)
+            return;
+        inEvent.preventDefault();
+        if (this.href != '#')
+            location.href = this.href;
+        this.bubble('onNavigate');
+        return true;
+    }
 });