Created
August 13, 2011 01:06
-
-
Save roblg/1143350 to your computer and use it in GitHub Desktop.
Connect to every event on a dojo widget, and log when the event is fired.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var k in widget) { | |
// connect to functions that start with 'on'. Seems pretty close to what we want... | |
if (k.substring(0,2) === 'on' && typeof this.editor[k] == 'function') { | |
(dojo.hitch(this, function (func) { | |
this.connect(widget, func, function () { | |
console.log("editor." + func); | |
}); | |
}))(k); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment