monaco-editor/test/mouse-fixed.html

31 lines
977 B
HTML
Raw Normal View History

2016-06-24 05:59:58 +08:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body style="height:2000px">
<h2>Monaco Editor in fixed element</h2>
<div style="position: fixed; left: 20%; top: 20%; right: 20%; height: 400px; border:1px solid silver" id="Editor">
<script src="../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>document.write('<script src="' + METADATA.CORE.path + '/loader.js"><'+'/script>');</script>
<script>
loadEditor(function() {
var ed =monaco.editor.create(document.getElementById('Editor'), {
value: document.documentElement.innerHTML.split(/\n|></).join('\n'),
language: 'xml'
});
ed.deltaDecorations([], [{
range: { startLineNumber:1, startColumn:1, endLineNumber:Number.MAX_VALUE, endColumn:Number.MAX_VALUE },
options: {
hoverMessage: 'come on'
}
}])
});
</script>
</body>
</html>