FIX: Show share popup only for valid buttons.
This commit is contained in:
parent
b3908a1d7f
commit
94c8410521
|
@ -93,7 +93,7 @@ export default Ember.Component.extend({
|
|||
return true;
|
||||
});
|
||||
|
||||
$html.on('click.discoure-share-link', '[data-share-url]', e => {
|
||||
$html.on('click.discoure-share-link', 'button[data-share-url]', e => {
|
||||
// if they want to open in a new tab, let it so
|
||||
if (wantsNewWindow(e)) { return true; }
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ test("Share Popup", () => {
|
|||
ok(!exists('#share-link.visible'), 'it is not visible');
|
||||
});
|
||||
|
||||
click("[data-share-url]:eq(0)");
|
||||
click("button[data-share-url]");
|
||||
andThen(() => {
|
||||
ok(exists('#share-link.visible'), 'it shows the popup');
|
||||
});
|
||||
|
@ -16,6 +16,16 @@ test("Share Popup", () => {
|
|||
andThen(() => {
|
||||
ok(!exists('#share-link.visible'), 'it closes the popup');
|
||||
});
|
||||
|
||||
click('#topic-footer-buttons .btn.create');
|
||||
fillIn('.d-editor-input', '<h2><div data-share-url="something">Click</button><h2>');
|
||||
|
||||
click('#reply-control .btn.create');
|
||||
click('h2 div[data-share-url]');
|
||||
|
||||
andThen(() => {
|
||||
ok(!exists('#share-link.visible'), 'it does not show the popup');
|
||||
});
|
||||
});
|
||||
|
||||
test("Showing and hiding the edit controls", () => {
|
||||
|
|
Loading…
Reference in New Issue