Great module - saved my bacon - http://www.imedstudios.com/labs/node/14
One thing I needed for my deployment was to turn off the AJAX flag set/unset. The reason is that I had other parts of the page that needed to update in response the flag state and doing the round trip normal page request was really the easiest way to make sure the entire page was updated.
There was no easy way I could find to turn off the inclusion of the Flag AJAX related JS. I could do some tricks in my theme $vars etc. but I was hoping for a quick check box in the flag configuration.
May I suggest adding such a feature to disable AJAX - it could be global or per flag - not sure what makes the most sense there. If I have time I'll try to at least write patch for a simple on/off global mode.
Because I was in a hurry I simply did
if ($setup) {
drupal_add_css(drupal_get_path('module', 'flag') .'/theme/flag.css');
//drupal_add_js(drupal_get_path('module', 'flag') .'/theme/flag.js');
}
in the flag.tpl.php
is there a better way? I tried moving flag.tpl.php to my custom theme but that didnt' work either.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Picture 1.png | 57.1 KB | quicksketch |
| #6 | Picture 12.png | 33.3 KB | dldege |
Comments
Comment #1
mooffie commentedThis feature exists already: There's a "Link Display Type" fieldset in the flag configuration page. You can choose among "JavaScript toggle", "Normal", "Confirm". You want "Normal".
The Admin UI lacks explanation. It doesn't explain why one should choose "Normal" instead of "Javascript toggle". You could invest your time in writing a patch that adds this explanation to that page.
Comment #2
mooffie commentedComment #3
dldege commentedHa, figures I made it harder then it needed to be since I was in a hurry.
Thanks for the explanation.
Comment #4
dldege commentedActually, digging into this I don't see this option. I'm not using views - is this what you were referring to? I'm adding the link to the node myself with the following.
Looking at the code for what happens from the above I don't see an option to control the JS behavior. I'm still not versed enough in your modules code base though to suggest the right patch.
Comment #5
mooffie commentedIt's on the settings form for the flag. Where you set the allowed note types for this flag, user roles, labels, etc. etc. See the bottom of that form.
(To switch the link type via code, I think you can do
$flag->link_type = 'normal'. The other possibilities are 'toggle' and 'confirm'.)Comment #6
dldege commentedSorry, I don't see this or the code options - could this be something in the D6 branch that has not been back ported?
Comment #7
quicksketchIt's already there, even in Drupal 5. It might only be in the Development version, so it'll be in beta7 (or the final release when that happens).
Comment #8
mooffie commentedOh. My apologies for misleading you, Dan. As Nathan pointed out, you have to use the 'dev' version.
Comment #9
mooffie commented(Dan, when I asked for a patch it was to solve a documentation issue: #364709: Clarify "Flag link" option descriptions)
Comment #10
dldege commentedOK now were getting somewhere! :)
I'll switch over to the other issue to followup on documentation patch.