Modify

Opened 8 years ago

Closed 8 years ago

#4295 closed enhancement (fixed)

[patch] More jQuery like js actions

Reported by: Catalin BALAN Owned by: Odd Simon Simonsen
Priority: normal Component: CustomFieldAdminPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hey osimons,

I've created a more jQuery like js actions for this plugin. What do you think ?

Thank you, Catalin Balan

Attachments (1)

customfieldadmin_r5022.diff (4.3 KB) - added by Catalin BALAN 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Catalin BALAN

Attachment: customfieldadmin_r5022.diff added

comment:1 Changed 8 years ago by Odd Simon Simonsen

Owner: changed from Odd Simon Simonsen to Catalin BALAN

If it works, then by all means - I've never really looked closely at your previous JS code anyway. The new code sure looks cleaner and more readable. Go for it.

comment:2 Changed 8 years ago by Odd Simon Simonsen

Owner: changed from Catalin BALAN to Odd Simon Simonsen

Decided to give it a spin anyway, but experienced some issues with the showing and hiding when switching between them when editing the various types. What I found the easiest, and also the most explicit, was simply stating the defaults for each without passing through to next case - no doubt it could be reorganised and tweaked, but this reads well and should be easy to maintain for anyone:

            case 0: // text
                label('#options, #cols, #rows').hide();
                break;
            case 1: // select
                label('#options, #cols, #rows').show();
                break;
            case 2: // checkbox
                label('#options, #cols, #rows').hide();
                break;
            case 3: // radio
                label('#options').show();
                label('#cols, #rows').hide();
                break;      
            case 4: // textarea
                label('#options').hide();
                label('#cols, #rows').show();
                break;

I've now set it up ready to commit, so I'll just go ahead and do it anyway if that is ok with you.

comment:3 Changed 8 years ago by Catalin BALAN

yeah, that ok.

Thank you, Catalin Balan

comment:4 Changed 8 years ago by Odd Simon Simonsen

Resolution: fixed
Status: newclosed

(In [5032]) CustomFieldAdminPlugin: Javscript rewrite using jQuery. All code from cbalan.

Closes #4295.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Odd Simon Simonsen.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.