Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
feat: add advancedRenderer options
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Finnie and paulrobert authored and douglasduteil committed Jan 7, 2015
1 parent c7953e7 commit 76fc37d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ This will copy the UI.Ace files into a `bower_components` folder, along with its
}"></div>
```

To include options applicable to the ACE renderer, you can use the `rendererOptions` key:

```html
<div ui-ace="{
rendererOptions: {
maxLinks: Infinity
}
}"></div>
```

## Support for concatenated bundles

Trying to use ace with concatenated javascript files usually fails because it changes the physical location of the `workerPath`. If you
Expand Down
15 changes: 13 additions & 2 deletions src/ui-ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,25 @@ angular.module('ui.ace', [])
}

// advanced options
var key, obj;
if (angular.isDefined(opts.advanced)) {
for (var key in opts.advanced) {
for (key in opts.advanced) {
// create a javascript object with the key and value
var obj = { name: key, value: opts.advanced[key] };
obj = { name: key, value: opts.advanced[key] };
// try to assign the option to the ace editor
acee.setOption(obj.name, obj.value);
}
}

// advanced options for the renderer
if (angular.isDefined(opts.rendererOptions)) {
for (key in opts.rendererOptions) {
// create a javascript object with the key and value
obj = { name: key, value: opts.rendererOptions[key] };
// try to assign the option to the ace editor
acee.renderer.setOption(obj.name, obj.value);
}
}
};

return {
Expand Down

0 comments on commit 76fc37d

Please sign in to comment.