mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Fixed live rendering not always happening on load
This commit is contained in:
parent
c49a34d495
commit
e40bb70232
@ -287,14 +287,10 @@ var panelInit = {
|
||||
},
|
||||
live: function () {
|
||||
function show() {
|
||||
var panel = this;
|
||||
$document.bind('jsbinReady', function () {
|
||||
if (panel.visible) {
|
||||
renderLivePreview(true);
|
||||
}
|
||||
});
|
||||
|
||||
renderLivePreview();
|
||||
// var panel = this;
|
||||
if (panels.ready) {
|
||||
renderLivePreview();
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
@ -318,9 +314,11 @@ editors.live = panelInit.live();
|
||||
|
||||
|
||||
// jsconsole.init(); // sets up render functions etc.
|
||||
editors.live.settings.render = function () {
|
||||
editors.console.render();
|
||||
renderLivePreview();
|
||||
editors.live.settings.render = function (showAlerts) {
|
||||
if (panels.ready) {
|
||||
editors.console.render();
|
||||
renderLivePreview(showAlerts);
|
||||
}
|
||||
};
|
||||
|
||||
// IMPORTANT this is nasty, but the sequence is important, because the
|
||||
@ -415,7 +413,7 @@ var editorsReady = setInterval(function () {
|
||||
|
||||
// if live is visible, render it
|
||||
if (panels.panels.live.visible) {
|
||||
panels.panels.live.render();
|
||||
panels.panels.live.render(true);
|
||||
}
|
||||
|
||||
if (panels.panels.console.visible) {
|
||||
|
||||
@ -128,7 +128,6 @@ Panel.prototype = {
|
||||
|
||||
$body.addClass('panelsVisible');
|
||||
|
||||
panel.visible = true;
|
||||
if (panel.settings.show) {
|
||||
panel.settings.show.call(panel, true);
|
||||
}
|
||||
@ -137,6 +136,7 @@ Panel.prototype = {
|
||||
// update the splitter - but do it on the next tick
|
||||
// required to allow the splitter to see it's visible first
|
||||
setTimeout(function () {
|
||||
panel.visible = true;
|
||||
if (x !== undefined) {
|
||||
panel.splitter.trigger('init', x);
|
||||
} else {
|
||||
@ -226,7 +226,7 @@ Panel.prototype = {
|
||||
if (panel.editor) {
|
||||
return panel.processor(panel.getCode());
|
||||
} else if (this.visible && this.settings.render) {
|
||||
this.settings.render.call(this);
|
||||
this.settings.render.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
init: function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user