File tree Expand file tree Collapse file tree 16 files changed +50
-44
lines changed
tests/integration/components Expand file tree Collapse file tree 16 files changed +50
-44
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ export default Component.extend({
77 serverError : null ,
88
99 didInsertElement ( ) {
10- if ( this . get ( 'api_token.isNew' ) ) {
11- this . $ ( 'input' ) . focus ( ) ;
10+ let input = this . element . querySelector ( 'input' ) ;
11+ if ( input . focus ) {
12+ input . focus ( ) ;
1213 }
1314 } ,
1415
Original file line number Diff line number Diff line change @@ -2,18 +2,12 @@ import Component from '@ember/component';
22
33export default Component . extend ( {
44 rendered : '' ,
5+
56 didRender ( ) {
67 this . _super ( ...arguments ) ;
7- this . $ ( 'pre > code' ) . each ( function ( ) {
8- window . Prism . highlightElement ( this ) ;
9- } ) ;
10- this . scrollToFragment ( ) ;
11- } ,
128
13- scrollToFragment ( ) {
14- if ( location . hash ) {
15- let anchor_id = location . hash . substr ( 1 ) ;
16- document . getElementById ( anchor_id ) . scrollIntoView ( ) ;
17- }
9+ this . element . querySelectorAll ( 'pre > code' ) . forEach ( function ( node ) {
10+ window . Prism . highlightElement ( node ) ;
11+ } ) ;
1812 } ,
1913} ) ;
Original file line number Diff line number Diff line change 11import Component from '@ember/component' ;
22import { alias } from '@ember/object/computed' ;
33import { computed } from '@ember/object' ;
4- import $ from 'jquery' ;
54
65import RlDropdownContainer from './rl-dropdown-container' ;
76
@@ -15,26 +14,17 @@ export default Component.extend({
1514
1615 isExpanded : alias ( 'dropdownContainer.dropdownExpanded' ) ,
1716
18- closeOnChildClick : false ,
19-
20- propagateClicks : true ,
21-
2217 click ( event ) {
23- let closeOnChildClick = this . closeOnChildClick ;
24- let propagateClicks = this . propagateClicks ;
25- let $target = $ ( event . target ) ;
26- let $c = this . $ ( ) ;
18+ let closeOnChildClick = 'a:link' ;
19+ let $target = event . target ;
20+ let $c = this . element ;
2721
28- if ( $target !== $c ) {
29- if ( ( closeOnChildClick === true || closeOnChildClick === 'true' ) && $target . closest ( $c ) . length ) {
30- this . set ( 'isExpanded' , false ) ;
31- } else if ( closeOnChildClick && $target . closest ( closeOnChildClick , $c ) . length ) {
32- this . set ( 'isExpanded' , false ) ;
33- }
22+ if ( $target === $c ) {
23+ return ;
3424 }
3525
36- if ( propagateClicks === false || propagateClicks === 'false' ) {
37- event . stopPropagation ( ) ;
26+ if ( $target . closest ( closeOnChildClick , $c ) . length ) {
27+ this . set ( 'isExpanded' , false ) ;
3828 }
3929 } ,
4030} ) ;
Original file line number Diff line number Diff line change 4040 <span class =' arrow' ></span >
4141 {{ /rl-dropdown-toggle }}
4242
43- {{ #rl-dropdown tagName =" ul" id =" doc-links" class =" dropdown" closeOnChildClick = " a:link " }}
43+ {{ #rl-dropdown tagName =" ul" id =" doc-links" class =" dropdown" }}
4444 <li ><a href =' https://doc.rust-lang.org/cargo/getting-started/' >Getting Started</a ></li >
4545 <li ><a href =' https://doc.rust-lang.org/cargo/guide/' >Guide</a ></li >
4646 <li ><a href =' https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html' >Specifying Dependencies</a ></li >
6666 <span class =' arrow' ></span >
6767 {{ /rl-dropdown-toggle }}
6868
69- {{ #rl-dropdown tagName =" ul" class =" dropdown current-user-links" closeOnChildClick = " a:link " }}
69+ {{ #rl-dropdown tagName =" ul" class =" dropdown current-user-links" }}
7070 <li >{{ #link-to ' dashboard' }} Dashboard{{ /link-to }} </li >
7171 <li >{{ #link-to ' me' }} Account Settings{{ /link-to }} </li >
7272 <li >{{ #link-to ' me.pending-invites' }} Owner Invites{{ /link-to }} </li >
8787 Menu
8888 <span class =' arrow' ></span >
8989 {{ /rl-dropdown-toggle }}
90- {{ #rl-dropdown tagName =' ul' class =' dropdown current-user-links' closeOnChildClick = ' a:link ' }}
90+ {{ #rl-dropdown tagName =' ul' class =' dropdown current-user-links' }}
9191 <li >{{ #link-to " crates" }} Browse All Crates{{ /link-to }} </li >
9292 {{ #if session.currentUser }}
9393 <li >{{ #link-to ' dashboard' }} Dashboard{{ /link-to }} </li >
Original file line number Diff line number Diff line change 2323 <span class =' arrow' ></span >
2424 {{ /rl-dropdown-toggle }}
2525
26- {{ #rl-dropdown tagName =" ul" class =" dropdown" closeOnChildClick = " a:link " }}
26+ {{ #rl-dropdown tagName =" ul" class =" dropdown" }}
2727 <li >
2828 {{ #link-to (query-params sort =" alpha" )}}
2929 Alphabetical
Original file line number Diff line number Diff line change 5656 <span class =' arrow' ></span >
5757 {{ /rl-dropdown-toggle }}
5858
59- {{ #rl-dropdown tagName =" ul" class =" dropdown" closeOnChildClick = " a:link " }}
59+ {{ #rl-dropdown tagName =" ul" class =" dropdown" }}
6060 <li >
6161 {{ #link-to (query-params sort =" alpha" )}}
6262 Alphabetical
Original file line number Diff line number Diff line change 66 placeholder =" New token name"
77 disabled =api_token.isSaving
88 value =api_token.name
9- autofocus =true
10- enter =" saveToken" }}
9+ autofocus =" autofocus"
10+ enter =" saveToken"
11+ data-test-focused-input =true
12+ }}
1113 {{ else }}
1214 {{ api_token.name }}
1315 {{ /if }}
Original file line number Diff line number Diff line change 4444 <span class =' arrow' ></span >
4545 {{ /rl-dropdown-toggle }}
4646
47- {{ #rl-dropdown tagName =" ul" class =" dropdown" closeOnChildClick = " a:link " }}
47+ {{ #rl-dropdown tagName =" ul" class =" dropdown" }}
4848 <li >
4949 {{ #link-to (query-params page =1 sort =" alpha" )}}
5050 Alphabetical
Original file line number Diff line number Diff line change 2424 <span class =' arrow' ></span >
2525 {{ /rl-dropdown-toggle }}
2626
27- {{ #rl-dropdown tagName =" ul" class =" dropdown" closeOnChildClick = " a:link " }}
27+ {{ #rl-dropdown tagName =" ul" class =" dropdown" }}
2828 <li >
2929 {{ #link-to (query-params sort =" alpha" )}}
3030 Alphabetical
Original file line number Diff line number Diff line change 2323 <span class =' arrow' ></span >
2424 {{ /rl-dropdown-toggle }}
2525
26- {{ #rl-dropdown tagName =" ul" class =" dropdown" closeOnChildClick = " a:link " }}
26+ {{ #rl-dropdown tagName =" ul" class =" dropdown" }}
2727 <li >
2828 {{ #link-to (query-params sort =" alpha" )}}
2929 Alphabetical
You can’t perform that action at this time.
0 commit comments