X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FLink.js;h=36cfb30f9e1bda7a9506c716e624c29f399360fb;hb=4720a1f90f7d42f3611f064cc5ba3d768a92b5c6;hp=929e1a582a8b738741d3bcec6c0023467d2c4725;hpb=21db04ef3e4f66d7b5c4c9be2be36703b18cbcaa;p=blerg.git diff --git a/www/jssrc/blerg/Link.js b/www/jssrc/blerg/Link.js index 929e1a5..36cfb30 100644 --- a/www/jssrc/blerg/Link.js +++ b/www/jssrc/blerg/Link.js @@ -1,5 +1,25 @@ 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) { + inEvent.preventDefault(); + if (this.href != '#') + location.href = this.href; + this.bubble('onNavigate'); + return true; + } });