Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #16944 from crdlc/bug-980237
Browse files Browse the repository at this point in the history
Bug 980237 - The bookmarks edition screen closes automatically
  • Loading branch information
Cristian Rodriguez committed Mar 6, 2014
2 parents fcc877f + 6db0c7f commit 0d588b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/homescreen/js/edit_dialog.js
Expand Up @@ -12,12 +12,14 @@ var EditDialog = (function() {
form.removeEventListener('input', updateDoneButton);

var classList = dialog.classList;
dialog.addEventListener('transitionend', function hidden() {
dialog.removeEventListener('transitionend', hidden);
classList.remove('visible');
});
if (classList.contains('show')) {
dialog.addEventListener('transitionend', function hidden() {
dialog.removeEventListener('transitionend', hidden);
classList.remove('visible');
});

classList.remove('show');
classList.remove('show');
}
}

function show(icon) {
Expand Down
8 changes: 8 additions & 0 deletions apps/homescreen/test/unit/edit_dialog_test.js
Expand Up @@ -156,4 +156,12 @@ suite('edit_dialog.js >', function() {
assert.isFalse(setURLSpy.called);
assertDialogIsHidden();
});

test(' Hide edit dialog twice - no transitionend listeners lost', function() {
var dialogSpy = this.sinon.spy(dialog, 'addEventListener');
EditDialog.hide();
EditDialog.hide();
sinon.assert.callCount(dialogSpy, 1);
dialogSpy.restore();
});
});

0 comments on commit 0d588b2

Please sign in to comment.