Skip to content

Commit

Permalink
Merge pull request #1084 from ajaxorg/theme-padding
Browse files Browse the repository at this point in the history
allow themes to set padding
  • Loading branch information
Mostafa Eweda committed Nov 7, 2012
2 parents 2c86ab5 + 329ed75 commit 64421a0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/ace/virtual_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 64421a0

Please sign in to comment.