Skip to content

Commit 33b82a3

Browse files
committed
Merge pull request selectize#584 from barretts/patch-1
corrected method override example
2 parents 74e8953 + 239abf9 commit 33b82a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/plugins.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Methods should be extended by [wrapping them](http://coreymaynard.com/blog/exten
4141

4242
```js
4343
var self = this;
44-
this.someMethod = function() {
44+
this.someMethod = (function() {
4545
var original = self.someMethod;
4646
return function() {
4747
// do your logic
4848
return original.apply(this, arguments);
4949
};
50-
});
50+
})();
5151
```
5252

5353
**Important:** If the method you're overriding returns a value, make sure the
@@ -98,4 +98,4 @@ $('select').selectize({
9898
});
9999
```
100100

101-
For a more detailed description of plugin option formats and how the plugin system works, check out the [microplugin](https://github.com/brianreavis/microplugin.js) documentation.
101+
For a more detailed description of plugin option formats and how the plugin system works, check out the [microplugin](https://github.com/brianreavis/microplugin.js) documentation.

0 commit comments

Comments
 (0)