From 09437ee5de41efd6cb9570bf1bd480279708e67c Mon Sep 17 00:00:00 2001 From: Jamie Burkart Date: Fri, 20 May 2016 20:31:15 -0400 Subject: [PATCH] allow any anchor element with the .href-to class to be recognized for a route transition on click as long as the element doesn't have an ember action. --- app/instance-initializers/browser/ember-href-to.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/instance-initializers/browser/ember-href-to.js b/app/instance-initializers/browser/ember-href-to.js index c5425c0..3c41b66 100644 --- a/app/instance-initializers/browser/ember-href-to.js +++ b/app/instance-initializers/browser/ember-href-to.js @@ -25,7 +25,15 @@ export default { let $target = Em.$(e.currentTarget); let handleClick = (e.which === 1 && !e.ctrlKey && !e.metaKey); - if(handleClick && !$target.hasClass('ember-view') && Em.isNone($target.attr('data-ember-action'))) { + if( handleClick && Em.isNone( $target.attr('data-ember-action') ) + && ( + !$target.hasClass('ember-view') + || ( + $target.hasClass('href-to') + && Em.isPresent($target.attr('href')) + ) + ) + ) { let url = $target.attr('href'); if(url && url.indexOf(rootURL) === 0) {