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

Commit

Permalink
Fixes for DOM exceptions when adding/removing nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhomes committed Apr 12, 2014
1 parent 351fca4 commit 23c9806
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions google-music-mac/js/appbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ if (typeof window.GMAppBar === 'undefined') {
exclude.push(document.querySelector('#gm-back'));
exclude.push(document.querySelector('#gm-forward'));
exclude.push(document.querySelector('#oneGoogleWrapper input[name="q"]').parentNode);
exclude.push(document.querySelector('#oneGoogleWrapper > div:first-child > div:first-child > div:first-child > div:first-child'));
exclude.concat(document.querySelectorAll('#oneGoogleWrapper > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div > div:first-child'));
exclude.concat(document.querySelectorAll('#oneGoogleWrapper > div:first-child > div:first-child > div:first-child > div'));

var appBar = document.querySelector('#oneGoogleWrapper');

Expand Down
4 changes: 0 additions & 4 deletions google-music-mac/js/lastfm.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ if (typeof window.LastFmButton === 'undefined') {

// Obtain the area on the top-right, containing the Google account information.
var rightArea = document.querySelector('#oneGoogleWrapper > div:first-child > div:first-child > div:first-child');

//// Remove all of the children.
//while (rightArea.childNodes.length)
// rightArea.removeChild(rightArea.childNodes[0]);

// Remove the +Google name in the top-right area.
if (rightArea.childNodes.length)
Expand Down
2 changes: 1 addition & 1 deletion google-music-mac/js/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (typeof window.Styles === 'undefined') {
},

removeStyle: function(key) {
if (Styles.appliedStyles[key]) {
if (Styles.appliedStyles[key] && Styles.appliedStyles[key].parentNode) {
Styles.appliedStyles[key].parentNode.removeChild(Styles.appliedStyles[key]);
delete Styles.appliedStyles[key];
}
Expand Down

0 comments on commit 23c9806

Please sign in to comment.