From 56b851a46f4ed0aae537c2c3b7058d76d42a73d8 Mon Sep 17 00:00:00 2001 From: Xavid Date: Fri, 18 Mar 2016 15:11:29 -0400 Subject: [PATCH] Pass through the "item" parameter to registerAceCommand callbacks. --- doc/api/editbar.md | 2 +- src/static/js/pad_editbar.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/editbar.md b/doc/api/editbar.md index ce89c0b7..d4ad4c64 100644 --- a/doc/api/editbar.md +++ b/doc/api/editbar.md @@ -12,7 +12,7 @@ Shows the dropdown `div.popup` whose `id` equals `dropdown`. Register a handler for a specific command. Commands are fired if the corresponding button is clicked or the corresponding select is changed. ## registerAceCommand(cmd, callback) -Creates an ace callstack and calls the callback with an ace instance: `callback(cmd, ace)`. +Creates an ace callstack and calls the callback with an ace instance (and a toolbar item, if applicable): `callback(cmd, ace, item)`. Example: ``` diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index d44e5d66..dd1c377a 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -242,9 +242,9 @@ var padeditbar = (function() }); }, registerAceCommand: function (cmd, callback) { - this.registerCommand(cmd, function (cmd, ace) { + this.registerCommand(cmd, function (cmd, ace, item) { ace.callWithAce(function (ace) { - callback(cmd, ace); + callback(cmd, ace, item); }, cmd, true); }); },