Skip to content

Commit 8e69963

Browse files
committed
Fixes #7.
1 parent 74183dc commit 8e69963

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

Apps/Sandcastle/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<div class="collapse navbar-collapse" id="toolbar-extend">
4343
<ul class="nav navbar-nav">
4444
<li id="buttonNew"><a href="#" data-bind="click: newDemo">New</a></li>
45-
<li class="hidden-xs disabled" id="buttonRun"><a href="#" data-bind="click: runDemo">Run (F8)</a></li>
45+
<li class="hidden-xs" id="buttonRun"><a href="#" data-bind="click: runDemo">Run (F8)</a></li>
4646
<li class="hidden-xs" id="buttonSuggest"><a href="#" data-bind="click:runSuggest">Suggest (Ctrl-Space)</a></li>
4747
<li class="hidden-xs" id="buttonNewWindow"><a href="#" data-bind="click:newWindow">Open in New Window</a></li>
4848
<li id="buttonCesium" class="visible-xs-block"><a href="#" data-bind="click: showPreview">Preview</a></li>

Apps/Sandcastle/js/CesiumSandcastle.js

+3-25
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ require({
237237
window.clearTimeout(hintTimer);
238238
}
239239
hintTimer = setTimeout(clearErrorsAddHints, 500);
240-
highlightRun();
241240
}
242241

243242
function scrollToLine(lineNumber) {
@@ -263,22 +262,6 @@ require({
263262
}
264263
}
265264

266-
function highlightRun(){
267-
// We don't want the run button to be enabled when the demo code is fetched in the beginning.
268-
if(runDisabled)
269-
{
270-
$('#buttonRun').removeClass('disabled');
271-
}
272-
else
273-
{
274-
runDisabled = true;
275-
}
276-
}
277-
278-
function clearRun(){
279-
$('#buttonRun').addClass('disabled');
280-
}
281-
282265
function openDocTab(title, link){
283266
// Bootstrap doesn't play nice with periods in tab IDs.
284267
var escapeTitle = title.replace('.','_');
@@ -359,7 +342,6 @@ require({
359342
}
360343

361344
function loadCesiumFrame(){
362-
$('#buttonRun').addClass('disabled');
363345
cesiumFrame.get(0).contentWindow.location.reload();
364346
var doc = '<html><head><script src="../../Build/Cesium/Cesium.js"></script><script type="text/javascript" src="./Sandcastle-header.js"></script><style>@import url(../../Build/Cesium/Widgets/widgets.css);\nhtml, body, #cesiumContainer {width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;}\n</style></head><body class="sandcastle-loading"><script type="text/javascript" src="./Sandcastle-client.js"></script></body></html>';
365347
cesiumFrame.get(0).contentWindow.document.open();
@@ -589,13 +571,9 @@ require({
589571

590572
this.runDemo = function(){
591573
$(".navbar-collapse").collapse('hide');
592-
// Reload the cesium frame with the new code only if run button is not disabled
593-
if(!($('#buttonRun').hasClass('disabled')))
594-
{
595-
consoleMessages.removeAll();
596-
runDisabled = false;
597-
loadCesiumFrame();
598-
}
574+
consoleMessages.removeAll();
575+
runDisabled = false;
576+
loadCesiumFrame();
599577
};
600578

601579
this.runSuggest = function(){

0 commit comments

Comments
 (0)