Open hanoii opened 7 years ago
@hanoii Yes, step no. 1 is necessary. Perhaps we should add something like jDrupal.addModule();
(and some corresponding docs) to make this more intuitive. Not many people get into jDrupal custom modules, 99% of the time people are using jDrupal by way of DrupalGap, and the usage of modules that way is much more well documented. Then we could have something like:
jDrupal.addModule('something');
function something_rest_pre_process(xhr, data) {
// Do something...
}
Your thoughts?
that's fine although it was mainly lack of documentation.
As for further thoughts/preference I would have preferred something that doesn't require me to add it to the global spec.
Maybe using javascript events.
Or, if you want to still add it to jDrupal, maybe do it in a way similar to Drupal.behaviors where what you add there has the methods self-contained.
But this could possible mean quite a in the logic for you I guess and as you say is for little uses.
Do I need to add something manually to jDrupal.modules for it to be picked up and then just define a function in the global scope?
so would it be:
jDrupal.modules['something']
and then2.
function something_rest_pre_process(xhr, data) {}
on the global spec?Is 1 necessary?