I load some libraries in my module by using this hook :
function food_truck_form_views_pre_render(&$view) {
if ($view->name == 'marqueurs_admin') {
drupal_add_css(libraries_get_path('animate') . '/animate.min.css');
drupal_add_js(libraries_get_path('bootstrap_notify') . '/bootstrap-notify.min.js');
drupal_add_js(drupal_get_path('module', 'food_truck_form') . '/js/food_truck_form_admin.js');
}
}
But when I write a notify in my food_truck_form_admin.js (this code) :
(function($) {
$.notify({
icon : 'fa fa-exclamation',
message : 'TEST'
}, {
animate : {
enter : 'animated flipInY',
exit : 'animated zoomOutUp'
},
type : 'danger'
});
})(jQuery);
I get this error :
2bootstrap-notify.min.js?o68oa5:1 Uncaught TypeError: this.$ele.find(...).on is not a function
have you got an idea ?
PS : is it the best method to load libraries ? I see on libraries API there was libraries_load... method but i don't understand how to use them :/