digital bumper sticker: fix so it doesn't cause JS errors when IITC is running

This commit is contained in:
Jon Atkins 2013-12-17 17:54:21 +00:00
parent bcc327acdd
commit f1aaad3c22

View File

@ -2,7 +2,7 @@
// @id iitc-digital-bumper-sticker // @id iitc-digital-bumper-sticker
// @name IITC Digital Bumper Sticker // @name IITC Digital Bumper Sticker
// @category Stock // @category Stock
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -14,6 +14,9 @@
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
var targetContainer = document.getElementById('dashboard_container');
if (targetContainer) {
var logoDiv = document.createElement('div'); var logoDiv = document.createElement('div');
logoDiv.setAttribute('style', "position: fixed; left: 20px; top: 130px; z-index: auto; pointer-events: none;"); logoDiv.setAttribute('style', "position: fixed; left: 20px; top: 130px; z-index: auto; pointer-events: none;");
@ -22,5 +25,5 @@ img.setAttribute('src', 'http://iitc.jonatkins.com/assets/img/prefer-iitc-200.pn
logoDiv.appendChild(img); logoDiv.appendChild(img);
var targetContainer = document.getElementById('dashboard_container');
targetContainer.appendChild(logoDiv); targetContainer.appendChild(logoDiv);
}