Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I got missing progress bar, and after inspection it turns out that the new ahah progress bar element is added next to the input tag (button).
Thus the styling (sliding - door technique) is broken.
I'm not quite sure that this is the best solution but it works for me :
/**
* Handler for the form redirection submission. fix for buttonsytle
*/
Drupal.ahah.prototype.beforeSubmit = function (form_values, element, options) {
// Disable the element that received the change.
$(this.element).addClass('progress-disabled').attr('disabled', true);
// Insert progressbar or throbber.
if (this.progress.type == 'bar') {
var progressBar = new Drupal.progressBar('ahah-progress-' + this.element.id, eval(this.progress.update_callback), this.progress.method, eval(this.progress.error_callback));
if (this.progress.message) {
progressBar.setProgress(-1, this.progress.message);
}
if (this.progress.url) {
progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
}
this.progress.element = $(progressBar.element).addClass('ahah-progress ahah-progress-bar');
this.progress.object = progressBar;
$(this.element).parent().after(this.progress.element);
}
else if (this.progress.type == 'throbber') {
this.progress.element = $('<div class="ahah-progress ahah-progress-throbber"><div class="throbber"> </div></div>');
if (this.progress.message) {
$('.throbber', this.progress.element).after('<div class="message">' + this.progress.message + '</div>')
}
$(this.element).parent().after(this.progress.element);
}
};
by putting the code above in my theme script.js then the new ahah element is attached after the span tag that wraps the button (input) tag
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedBrilliant, works with filefield ahah uploading.
Needs to be rolled into a patch for the module.
Comment #2
duckzland CreditAttribution: duckzland commentedI've been thinking about this module html tag, I think instead of modifying the ahah, modifying the html can be a cleaner way to fix the throbber.
right now if the button receives additional ahah throbber the html would be like :
But I think if we modify the html tag like :
then the ahah will be rendered on top of the left image
Maybe someone can create the proper patch for this?
Comment #3
Steven Jones CreditAttribution: Steven Jones commentedBut the javascript modifies the html to add the throbber in? So we need to fix the ahah js.
Comment #4
duckzland CreditAttribution: duckzland commentedyes the javascript modify the html, but only appending a new html element, if the new element is wrapped with the left side image then the throbber will stay on top of the button image.
Comment #5
Steven Jones CreditAttribution: Steven Jones commentedOuch, you're suggesting we actually change the markup for the buttons themselves, and basically have an extra wrapper div. Umm...not sure what implications that would have , and if that is necessarily the best solution.
Comment #6
duckzland CreditAttribution: duckzland commentedI havent actually try it yet, so I don't know if it is the best solution.
But from my thought, if we can force the ahah to be "wrapped" in image then all the fix for views, cck etc will be somehow not needed.
Because basically if we implement another wrapper then the button still act like "drupal normal" button ( input element with ahah throbber appended next to it) but with image wrapping.
so other contrib modules that follows "drupal normal" button in theory should not be broken at all.
Anyway those are just my idea, as I havent actually try them yet.
Cheers!
Comment #7
superdorx CreditAttribution: superdorx commentedA patch would be great!
Comment #8
ccavuoti CreditAttribution: ccavuoti commentedexcellent, thanks
Comment #9
ccavuoti CreditAttribution: ccavuoti commentedexcellent thanks, we might just find a better solution .. see the progress bar to the right of button? greeting