Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

allow themes to set padding #1084

Merged
merged 1 commit into from

2 participants

@mostafaeweda
Collaborator

@ajaxorg/liskov merged !

@mostafaeweda mostafaeweda merged commit 64421a0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 4, 2012
  1. @nightwing
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/ace/virtual_renderer.js
View
20 lib/ace/virtual_renderer.js
@@ -104,7 +104,6 @@ var VirtualRenderer = function(container, theme) {
this.$markerFront = new MarkerLayer(this.content);
this.$cursorLayer = new CursorLayer(this.content);
- this.$cursorPadding = 8;
// Indicates whether the horizontal scrollbar is visible
this.$horizScroll = false;
@@ -1324,18 +1323,19 @@ var VirtualRenderer = function(container, theme) {
_self.container.ownerDocument
);
- if (_self.$theme)
- dom.removeCssClass(_self.container, _self.$theme);
+ if (_self.theme)
+ dom.removeCssClass(_self.container, _self.theme.cssClass);
- _self.$theme = theme ? theme.cssClass : null;
+ // this is kept only for backwards compatibility
+ _self.$theme = theme.cssClass;
- if (_self.$theme)
- dom.addCssClass(_self.container, _self.$theme);
+ _self.theme = theme;
+ dom.addCssClass(_self.container, theme.cssClass);
+ dom.setCssClass(_self.container, "ace_dark", theme.isDark);
- if (theme && theme.isDark)
- dom.addCssClass(_self.container, "ace_dark");
- else
- dom.removeCssClass(_self.container, "ace_dark");
+ var padding = theme.padding || 4;
+ if (_self.$padding && padding != _self.$padding)
+ _self.setPadding(padding);
// force re-measure of the gutter width
if (_self.$size) {
Something went wrong with that request. Please try again.