File tree Expand file tree Collapse file tree 5 files changed +97
-93
lines changed
Expand file tree Collapse file tree 5 files changed +97
-93
lines changed Original file line number Diff line number Diff line change 1- import $ from 'jquery' ;
21import startsWith from 'lodash.startswith' ;
32
43import Component from '@ember/component' ;
5- import { isEmpty , isPresent } from '@ember/utils' ;
4+ import { isEmpty } from '@ember/utils' ;
65
76import layout from '../templates/components/set-links-target' ;
87
@@ -28,15 +27,13 @@ export default Component.extend({
2827 const origin = window . document . location . origin ;
2928 const targetValue = this . targetValue ;
3029 // for each anchor check if we should set the target
31- this . $ ( 'a' ) . each ( ( index , element ) => {
32- const link = $ ( element ) ;
33- // are we excluding links to self?
34- if ( isPresent ( link . attr ( 'href' ) ) && startsWith ( link . attr ( 'href' ) , origin ) && excludeSelfLinks ) {
30+ this . element . querySelectorAll ( 'a' ) . forEach ( element => {
31+ if ( element . hasAttribute ( 'href' ) && startsWith ( element . getAttribute ( 'href' ) , origin ) && excludeSelfLinks ) {
3532 return ;
3633 }
3734 // got this far, then apply a target if it hasn't already got one
38- if ( isEmpty ( link . attr ( 'target' ) ) ) {
39- link . attr ( 'target' , targetValue ) ;
35+ if ( isEmpty ( element . getAttribute ( 'target' ) ) ) {
36+ element . setAttribute ( 'target' , targetValue ) ;
4037 }
4138 } ) ;
4239 } ,
Original file line number Diff line number Diff line change 5959 "bootstrap-sass" : " ^3.4.3" ,
6060 "bootswatch" : " ^3.4.1" ,
6161 "broccoli-asset-rev" : " ^3.0.0" ,
62- "ember-cli" : " ~3.8.3 " ,
62+ "ember-cli" : " ~3.9.0 " ,
6363 "ember-cli-dependency-checker" : " ^3.1.0" ,
6464 "ember-cli-deploy" : " ^1.0.2" ,
6565 "ember-cli-deploy-build" : " ^2.0.0" ,
7979 "ember-maybe-import-regenerator" : " ^0.1.6" ,
8080 "ember-qunit" : " ^4.6.0" ,
8181 "ember-resolver" : " ^8.0.3" ,
82- "ember-source" : " ~3.8 .0" ,
82+ "ember-source" : " ~3.9 .0" ,
8383 "ember-source-channel-url" : " ^3.0.0" ,
8484 "ember-try" : " ^2.0.0" ,
8585 "eslint-plugin-ember" : " ^7.0.0" ,
Original file line number Diff line number Diff line change 33 "packages" : [
44 {
55 "name" : " ember-cli" ,
6- "version" : " 3.8.3 " ,
6+ "version" : " 3.9.0 " ,
77 "blueprints" : [
88 {
99 "name" : " addon" ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module.exports = function (environment) {
99 EmberENV : {
1010 FEATURES : {
1111 // Here you can enable experimental features on an ember canary build
12- // e.g. 'with-controller' : true
12+ // e.g. EMBER_NATIVE_DECORATOR_SUPPORT : true
1313 } ,
1414 EXTEND_PROTOTYPES : {
1515 // Prevent Ember Data from overriding Date.parse.
You can’t perform that action at this time.
0 commit comments