Skip to content

Commit

Permalink
Remove assignment to vue instance to fix IE11 issue. (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly authored and nicolasbeauvais committed Apr 9, 2019
1 parent 1042942 commit e17ef5f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/social-sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ export default {
*/
openSharer (network, url) {
// If a popup window already exist it will be replaced, trigger a close event.
if (this.popup.window && this.popup.interval) {
let popupWindow = null;
if (popupWindow && this.popup.interval) {
clearInterval(this.popup.interval);

this.popup.window.close();// Force close (for Facebook)
popupWindow.close();// Force close (for Facebook)

this.$root.$emit('social_shares_change', network, this.url);
this.$emit('change', network, this.url);
}

this.popup.window = window.open(
popupWindow = window.open(
url,
'sharer',
'status=' + (this.popup.status ? 'yes' : 'no') +
Expand All @@ -232,14 +233,14 @@ export default {
',directories=' + (this.popup.directories ? 'yes' : 'no')
);

this.popup.window.focus();
popupWindow.focus();

// Create an interval to detect popup closing event
this.popup.interval = setInterval(() => {
if (this.popup.window.closed) {
if (popupWindow.closed) {
clearInterval(this.popup.interval);

this.popup.window = undefined;
popupWindow = undefined;

this.$root.$emit('social_shares_close', network, this.url);
this.$emit('close', network, this.url);
Expand Down

0 comments on commit e17ef5f

Please sign in to comment.