[jifty-devel] Show/Hide region with effects

Dobrica Pavlinusic dpavlin at rot13.org
Mon May 7 17:27:44 EDT 2007


On Mon, May 07, 2007 at 04:57:02PM -0400, Jesse Vincent wrote:
>
> On May 7, 2007, at 3:21 PM, Dobrica Pavlinusic wrote:
>
>> But, it seems that confirm is triggered after beforeclick, which just 
>> seems
>> wrong. In my case, I hide results with beforeclick and *than* ask user 
>> "are you sure?".
>>
>> Or do we need afterclick which is triggered after confirm?
>
> I suspect that "beforeclick" should get renamed and we'll want another hook 
> after the confirm. To help figure out good names, would you be willing to 
> show us the code where you're using a confirm and the beforeclick handler?

Even whole application if needed :-) http://svn.rot13.org/index.cgi/Grep

but, relevant part is:

<span id="x<% $pos %>">
<% Jifty->web->link(
	label => '[X]',
	onclick => {
		args => { item_id => $item->id },
#		confirm => 'Delete this item from local cache?',
		element => '#r' . $pos,
		beforeclick => "Element.hide('x${pos}'); Element.hide('c${pos}');",
		append => '/fragments/delete',
	},
) %>&nbsp;</span>

Still using Mason, slow to move, I guess :-)

Code in question first hides link (to prevent user from clicking twice),
then hides element with real result and calls '/fragments/delete' which
is returns frendly message "item deleted".

FWIW, description of this app:  http://saturn.ffzg.hr/rot13/index.cgi?grep

-- 
Dobrica Pavlinusic               2share!2flame            dpavlin at rot13.org
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin



More information about the jifty-devel mailing list