I posed a question in this thread about getting at the module config, mainly so I could access the dynamic config that I can set in my orphan of CSUI::Extensions. This allows me to make my smart UI commands appear or not based on config settings in my module. Here is the thread:
If you built your command from the sample rename, you will no doubt have a define statement at the top like this:
define(['require', 'csui/lib/jquery', 'csui/utils/base', 'csui/utils/log',
'i18n!samples/commands/rename/impl/nls/lang', 'csui/lib/backbone',
'csui/models/command', 'csui/utils/commandhelper'
], function (require, $, base, log, lang, Backbone, CommandModel, CommandHelper) {
'use strict';
In order to access the module, you need to add it to the define statement above like this:
define(['require', 'csui/lib/jquery', 'csui/utils/base', 'csui/utils/log',
'i18n!samples/commands/rename/impl/nls/lang', 'csui/lib/backbone',
'csui/models/command', 'csui/utils/commandhelper', 'module'
], function (require, $, base, log, lang, Backbone, CommandModel, CommandHelper, module) {
'use strict';
Adding 'module' to the end of the list of define parameters, and adding module as a variable (in this case after Command Helper) is what worked.
I decided to post this as I went nuts trying to figure it out. Credit to
@Chris Meyer who discovered this. Hopefully this information will be useful to someone else in the future.
-Hugh