mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 08:45:05 +00:00
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;
|
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 they want to open in a new tab, let it so
|
||||||
if (wantsNewWindow(e)) { return true; }
|
if (wantsNewWindow(e)) { return true; }
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ test("Share Popup", () => {
|
|||||||
ok(!exists('#share-link.visible'), 'it is not visible');
|
ok(!exists('#share-link.visible'), 'it is not visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
click("[data-share-url]:eq(0)");
|
click("button[data-share-url]");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
ok(exists('#share-link.visible'), 'it shows the popup');
|
ok(exists('#share-link.visible'), 'it shows the popup');
|
||||||
});
|
});
|
||||||
@ -16,6 +16,16 @@ test("Share Popup", () => {
|
|||||||
andThen(() => {
|
andThen(() => {
|
||||||
ok(!exists('#share-link.visible'), 'it closes the popup');
|
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", () => {
|
test("Showing and hiding the edit controls", () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user