Skip to content

Commit 12b5608

Browse files
author
caoxinke
committed
editor页面预览全屏
1 parent 2cd0ad8 commit 12b5608

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

examples/js/editor.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function initCodeEditor() {
4646
}
4747
aceEditor.setValue($('#editor').val());
4848
aceEditor.clearSelection();
49-
aceEditor.moveCursorTo(0,0);
49+
aceEditor.moveCursorTo(0, 0);
5050
}
5151

5252
//初始化编辑器以及预览内容
@@ -100,12 +100,9 @@ function run() {
100100
function loadPreview(content) {
101101
var iFrame = document.getElementById("innerPage").contentWindow;
102102
iFrame.document.open();
103+
iFrame.addEventListener("load",mapHeight);
103104
iFrame.document.write(content);
104105
iFrame.document.close();
105-
iFrame.onload = function () {
106-
mapHeight();
107-
};
108-
109106
}
110107

111108
/**设置显示源码的拖拽效果**/

examples/js/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function createGalleryChart(example) {
7979

8080
var chartDiv = $("<div class='col-lg-2 col-md-4 col-sm-6'></div>");
8181
var chart = $("<div class='chart'></div>");
82-
var link = $("<a class='chart-link' target='_new' href='" + target + "#" + href + "'></a>");
82+
var link = $("<a class='chart-link' target='_blank' href='" + target + "#" + href + "'></a>");
8383
var chartTitle = $("<h5 class='chart-title'>" + title + "</h5>");
8484
var thumb = $("<img class='chart-area' src='" + thumbnail + "' style='display: inline;'>");
8585

0 commit comments

Comments
 (0)