Skip to content

Commit

Permalink
Merge pull request #1698 from /issues/1696/1
Browse files Browse the repository at this point in the history
Issue #1696. Unbreak Save & close label editor button.
  • Loading branch information
brizental authored Aug 3, 2017
2 parents b5c0547 + 8236a9d commit 5e8337c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions tests/functional/labels-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,27 @@ define(
assert.notInclude("is-active", className);
})
.end();
},

"Clicking close button actually closes it?": function() {
return FunctionalHelpers.openPage(
this,
url("/issues/2"),
".js-LabelEditorLauncher",
true /* longerTimeout */
)
.findByCssSelector(".js-LabelEditorLauncher")
.click()
.end()
.findByCssSelector(".js-LabelEditor-close")
.click()
.end()
.findByCssSelector(".js-LabelEditorLauncher")
.getAttribute("class")
.then(function(className) {
assert.notInclude("is-active", className);
})
.end();
}
};
});
Expand Down
2 changes: 1 addition & 1 deletion webcompat/static/js/lib/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ issues.LabelEditorView = Backbone.View.extend({
this.reRender({ labels: _.uniq(modelUpdate) });
},
closeEditor: function(e) {
if (!e || (e && e.keyCode === 27)) {
if (!e || (e && (e.keyCode === 27 || !e.keyCode))) {
var checked = $("input[type=checkbox]:checked");
var labelsArray = _.pluck(checked, "name");
this.issueView.editorButton.removeClass("is-active");
Expand Down
2 changes: 1 addition & 1 deletion webcompat/static/js/templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webcompat/templates/web_modules/label-editor.jst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script type="text/template">
<div class="wc-LabelEditor-header">
<input class="form-control wc-LabelEditor-search" placeholder="filter label">
<button class="wc-LabelEditor-button r-ResetButton" tabindex="0">
<button class="wc-LabelEditor-button r-ResetButton js-LabelEditor-close"
tabindex="0">
Save &amp; Close
</button>
</div>
Expand Down

0 comments on commit 5e8337c

Please sign in to comment.