Modify

Opened 6 years ago

Closed 6 years ago

#4295 closed enhancement (fixed)

[patch] More jQuery like js actions

Reported by: cbalan Owned by: osimons
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 cbalan 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by cbalan

comment:1 Changed 6 years ago by osimons

  • Owner changed from osimons to cbalan

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 6 years ago by osimons

  • Owner changed from cbalan to osimons

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 6 years ago by cbalan

yeah, that ok.

Thank you,
Catalin Balan

comment:4 Changed 6 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

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

Closes #4295.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.