diff --git a/demo/startup.js b/demo/startup.js index d46622bf..9193dd87 100644 --- a/demo/startup.js +++ b/demo/startup.js @@ -253,6 +253,16 @@ exports.launch = function(env) { return event.preventDefault(e); }); + + // gutter + editor = env.editor + toggleGutter=function(){ + editor.renderer.setShowGutter(!editor.renderer.showGutter) + } + // + window.ace={ + editor: editor + } }; }); diff --git a/demo/styles.css b/demo/styles.css index 3f244f7c..8fd3bc01 100644 --- a/demo/styles.css +++ b/demo/styles.css @@ -44,4 +44,20 @@ body { -moz-border-radius-topright: 10px; border-top-left-radius: 4px; border-top-right-radius: 4px; background: #DDD; color: #000; +} + +#toggleGutter{ + height:8px; + width:20px; + background:lightblue; + bottom:0; + position:absolute; + z-index: 1000; + -moz-border-radius-topright: 20px; +} + +#toggleGutter:hover{ + -moz-box-shadow: 2px -1px 5px 3px #91B6D5; + border-right: 1px solid #A1A1CF; + border-top: 1px solid #A1A1CF; } \ No newline at end of file diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 99a43894..f1a5d669 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -260,6 +260,8 @@ var VirtualRenderer = function(container, theme) { }; this.setShowGutter = function(show){ + if(this.showGutter === show) + return; this.$gutter.style.display = show ? "block" : "none"; this.showGutter = show; this.onResize(true);