Is it possible to add an ajax loader image to the dialog until the content gets loaded?
The problem: I have some database queries they need some time to load and I thought if someone else use my modul he could think it didn't work. So I just add to my dialog an ajax loader image to give the user an feedback. Yes something is turning like a wheel this must be good... My problem now is that I completly changed my modul to work with yours as a dependency. So is this is a nice idea?

Comments

broncomania’s picture

Title: Ajax loader ability » Example didn't work for me
Component: User interface » Documentation
Category: feature » bug
Status: Needs work » Active

I tried to integrate your modul to work with mine together and I got at it, but on the way I found maybe an error. In your documentation you wrote this.

btns[Drupal.t('Cancel')] =  function() {
      $(this).dialog("close");
};

var aurl = Drupal.settings.basePath+'index.php?q=ajax/wysiwyg_imgupl/add/'+form_id;
Drupal.jqui_dialog.open({url:aurl, buttons: btns,width:540});

I followed the steps and I found maybe a mistake. Mozillas firebug said that btns is not known. At least I removed the btns and I got it, but now I didn't now how to get the buttons working. Could you explain it a little more for the fools like me?

EugenMayer’s picture

Category: bug » support
Status: Active » Fixed
var btns[Drupal.t('Cancel')] =  function() {
      $(this).dialog("close");
};

All you need is adding "var" to declare btns. Anyway this module is not audienced to people with few / no JS knowledge. If you need further examples how to work with this plugin, just look at the wysiwyg_imageupload module.

Its not a bug, its rather an example.

Anyway thank you for the hint, just skipped that one when i copied the code from WUI

broncomania’s picture

Ahhh thank you! Sometimes it's so simple!
I found out like in your modul its the missing

var btns = {};

That solve the problem. It wasn't the var infront of the btns. Is it a declaration of an array? Maybe ...
Anyway thanx for your help. Your modul is still great and I included it into my modul with success and a smiling.

EugenMayer’s picture

Cool :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.