diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 5a2efed6..a42ff3a7 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -360,16 +360,16 @@ td input { #pluginsNav .priority { display: none; } -#pluginsNav.editMode li:hover .priority { +body.editMode #pluginsNav li:hover .priority { display: inline; } -#pluginsNav.editMode li:hover .name { +body.editMode #pluginsNav li:hover .name { display: none; } -header.editMode { +body.editMode header { color: #999; } -header.editMode #headerOverlay { +body.editMode header #headerOverlay { z-index: 3; width: 100%; height: 100%; diff --git a/resources/report/js/custom.js b/resources/report/js/custom.js index 1b12718e..be50cfb9 100644 --- a/resources/report/js/custom.js +++ b/resources/report/js/custom.js @@ -163,11 +163,15 @@ var pluginCardProto = Object.create(HTMLElement.prototype, { } } - /* Disable priority hover in plugins list. */ - document.getElementById('pluginsNav').classList.toggle('editMode', false); + /* Disable priority hover in plugins list and enable header + buttons if this is the only editor instance. */ + var numEditors = parseInt(document.body.getAttribute('data-editors'), 10); + --numEditors; - /* Enable header buttons. */ - document.getElementsByTagName('header')[0].classList.toggle('editMode', false); + if (numEditors == 0) { + document.body.classList.remove('editMode'); + } + document.body.setAttribute('data-editors', numEditors); /* Hide editor. */ card.classList.toggle('flip'); @@ -204,10 +208,18 @@ var pluginCardProto = Object.create(HTMLElement.prototype, { } } - /* Enable priority hover in plugins list. */ - document.getElementById('pluginsNav').classList.toggle('editMode', true); - /* Disable header buttons. */ - document.getElementsByTagName('header')[0].classList.toggle('editMode', true); + /* Enable priority hover in plugins list and enable header + buttons if this is the only editor instance. */ + var numEditors = 0; + if (document.body.hasAttribute('data-editors')) { + numEditors = parseInt(document.body.getAttribute('data-editors'), 10); + } + ++numEditors; + + if (numEditors == 1) { + document.body.classList.add('editMode'); + } + document.body.setAttribute('data-editors', numEditors); /* Now show editor. */ this.classList.toggle('flip');