Skip to content

Commit

Permalink
Remove spurious code
Browse files Browse the repository at this point in the history
  • Loading branch information
nainar committed Feb 12, 2018
1 parent b419291 commit f58b751
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
8 changes: 3 additions & 5 deletions extensions/amp-selector/0.1/amp-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class AmpSelector extends AMP.BaseElement {

/**
* Handles selectUp events.
* @param {!Event} event
* @param {!integer} incrementPos
*/
select_(incrementPos) {

Expand All @@ -346,9 +346,7 @@ export class AmpSelector extends AMP.BaseElement {
}

const selectedOption = this.options_[selectedIndex_];
// if (selectedOption) {
this.onOptionPicked_(selectedOption);
// }
this.onOptionPicked_(selectedOption);
}

/**
Expand All @@ -363,7 +361,7 @@ export class AmpSelector extends AMP.BaseElement {
case KeyCodes.RIGHT_ARROW: /* fallthrough */
case KeyCodes.DOWN_ARROW:
if (this.kbSelectMode_ != KEYBOARD_SELECT_MODES.NONE) {
this.navigationKeyDownHandler_(event, true);
this.navigationKeyDownHandler_(event);
}
return;
case KeyCodes.ENTER: /* fallthrough */
Expand Down
1 change: 0 additions & 1 deletion extensions/amp-selector/0.1/test/test-amp-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,5 @@ describes.realWin('amp-selector', {
expect(ampSelector.children[3].hasAttribute('selected')).to.be.false;
});
});

});
});
14 changes: 0 additions & 14 deletions extensions/amp-selector/0.1/test/validator-amp-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@
<script async custom-element="amp-live-list" src="https://cdn.ampproject.org/v0/amp-live-list-0.1.js"></script>
</head>
<body>

<form action="/" method="get" target="_blank" id="form1">
<!-- <amp-selector> with the options as list elements -->
<amp-selector layout="container" name="ampSelector" id="ampSelector">
<ul>
<li><amp-img src="https://www.anthonyberrick.com.au/wp-content/uploads/bb-plugin/cache/6785080-cute-puppy-square.jpg" width=50 height=50 option="1"></amp-img></li>
<li><amp-img src="http://www.readersdigest.ca/wp-content/uploads/2011/01/4-ways-cheer-up-depressed-cat.jpg" width=50 height=50 option="2"></amp-img></li>
<li option="na" selected>None of the Above</li>
</ul>
<input type="button" name="testTarget" on="click:ampSelector.selectUp()" value="BUTTON!">
</amp-selector>

</form>

<!-- Valid -->
<form action="/" method="get" target="_blank" id="form1">
<!-- <amp-selector> with the options as list elements -->
Expand Down

0 comments on commit f58b751

Please sign in to comment.