Skip to content

Commit

Permalink
Move UI-WELCOME_ERROR from a script insertion to a hidden <div>
Browse files Browse the repository at this point in the history
* store the error message in an extra div for later retrieval

Fixes: #10580
  • Loading branch information
srl295 committed Mar 7, 2017
1 parent 06049c2 commit 6c30eb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/views/ui_app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ block content
box-shadow: inset -10px 0 20px -10px rgba(0, 0, 0, 0.5);
}

#kibanaLoader__error {
display: none;
}

.kibanaLoader__content {
display: -webkit-box;
display: -webkit-flex;
Expand Down Expand Up @@ -94,9 +98,12 @@ block content
.kibanaWelcomeLogo
.kibanaLoader__content
| #{i18n('UI-WELCOME_MESSAGE')}
#kibanaLoader__error
| #{i18n('UI-WELCOME_ERROR')}

script.
window.onload = function () {
var failureText = document.getElementById('kibanaLoader__error').innerText;
var buildNum = #{kibanaPayload.buildNum};
var cacheParam = buildNum ? '?v=' + buildNum : '';
function bundleFile(filename) {
Expand Down Expand Up @@ -125,7 +132,7 @@ block content
err.style['text-align'] = 'center';
err.style['background'] = '#F44336';
err.style['padding'] = '25px';
err.innerText = '#{i18n('UI-WELCOME_ERROR')}';
err.innerText = failureText;

document.body.innerHTML = err.outerHTML;
}
Expand Down

0 comments on commit 6c30eb7

Please sign in to comment.