Skip to content

Commit

Permalink
Implemented "New Tab" Page Update
Browse files Browse the repository at this point in the history
On update, delete or addition of events, "New Tab" page also gets updated through page refresh.
  • Loading branch information
AsifulNobel committed Feb 25, 2017
1 parent 1a0aa18 commit 1b57e15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions js/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ function saveEvent() {
});

clearError();
updateEvent();
window.location.reload();
}
})
}
Expand Down Expand Up @@ -179,9 +181,20 @@ function deleteEvent() {
});

clearError();
updateEvent();
}
})

parent.innerText = '';
parent.parentElement.removeChild(parent);
}

function updateEvent() {
// When Events are added, updated or deleted on options page,
// 'New Tab' page also refreshes
chrome.tabs.query({url: 'chrome://newtab/'},function(tabs){
tabs.forEach(function(tab){
chrome.tabs.reload(tab.id);
});
});
}
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},

"permissions": [
"storage"
"storage",
"tabs"
]
}

0 comments on commit 1b57e15

Please sign in to comment.