In file bs_shortcode.module, function bs_shortcodes_preprocess_page() you don't check condition to add file custom.js. Error will occur when page don't include file bootstrap.min.js (example admin use theme seven). Function tooltip,popover is undefined.

  $("a.hint").tooltip();
  $("a.hintbox").popover();
  $(".hintbox1").popover();

This error will bearing to other module have use jquery. I think you need check condition better.

Comments

doidd created an issue. See original summary.

doidd’s picture

Issue summary: View changes
joaogarin’s picture

I think one problem with this is you dont really know where the bootstrap file might be..Its not always loaded via Libraries, it can be loaded directly in a theme for example. So what would the check be like?

The module assumes bootstrap is loaded, for seven theme for example you can load fontawesome via libraries and then it will be loaded also with the Seven theme. if you load it in the theme itself, then the error will occur when the bootstrap file is not present.

doidd’s picture

I don't think that. As you said, boostrap js is not always loaded. Meanwhile, file custom.js is always loaded. It is unnecessary to load file boostrap.js in admin theme. Because admin theme does not have preview option.

Loading file boostrap.js is not a problem with me. However, we have to control this because the module is being used by many user. This is my opinion.

joaogarin’s picture

Yes I am not objecting to that. I think if we can make that is great.

But what exactly would you check for? I dont think there is a location where you can check bootstrap is loaded or not. Or just dont load custom.js in the admin themes? Some people use their own theme as a backend theme, I know its not common, but still..don't know.

I don't really object to the idea, but I don't know if that would be even possible. If yes then great.

doidd’s picture

This is one way, edit code file custom.js:

jQuery(function($) {
  if (typeof $.fn.tooltip == 'function') {
    $("a.hint").tooltip();
  }
  if (typeof $.fn.popover == 'function') {
    $("a.hintbox").popover();
    $(".hintbox1").popover();
  }
});

I will try find other way.