Skip to content

Commit

Permalink
Added direct access to plugin instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgorbatchev committed Jan 14, 2012
1 parent a185c4f commit 35ff335
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/js/textext.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
* function will create a new instance of the plugin. *Without registering, the core won't
* be able to see the plugin.*
*
* <span class="new label version">new in 1.2.0</span> You can get instance of each plugin from the core
* via associated function with the same name as the plugin. For example:
*
* $('#input').textext()[0].tags()
* $('#input').textext()[0].autocomplete()
* ...
*
* @author agorbatchev
* @date 2011/08/19
* @id TextExtPlugin
Expand Down Expand Up @@ -795,6 +802,7 @@
if(plugin)
{
self._plugins[name] = plugin = new plugin();
self[name] = function() { return plugin; };
initList.push(plugin);
$.extend(true, plugin, self.opts(OPT_EXT + '.*'), self.opts(OPT_EXT + '.' + name));
}
Expand Down

0 comments on commit 35ff335

Please sign in to comment.