Changeset 1056 for trunk/web-app


Ignore:
Timestamp:
Nov 3, 2010, 12:58:27 PM (12 years ago)
Author:
robert@…
Message:

Changed template editor to be more user friendly with selecting field types (see ticket #154)

Location:
trunk/web-app
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/css/templateEditor.css

    r1027 r1056  
    110110}
    111111
     112.sorting_asc {
     113        background:url("../images/icons/sort_asc.png") no-repeat scroll right center transparent;
     114}
     115.sorting_desc {
     116        background:url("../images/icons/sort_desc.png") no-repeat scroll right center transparent;
     117}
     118.sorting {
     119        background:url("../images/icons/sort_both.png") no-repeat scroll right center transparent;
     120}
     121.sorting_asc_disabled {
     122        background:url("../images/icons/sort_asc_disabled.png") no-repeat scroll right center transparent;
     123}
     124.sorting_desc_disabled {
     125        background:url("../images/icons/sort_desc_disabled.png") no-repeat scroll right center transparent;
     126}
     127
     128#compare_templates th {white-space: nowrap;}
     129.longTitle { display: none; }
    112130
    113131
  • trunk/web-app/js/templateEditor.js

    r996 r1056  
    5555}
    5656
     57
     58/**
     59 * Clears the form after adding a template
     60 */
     61function clearTemplateForm( id ) {
     62    $( '#template_' + id + '_form input#name' ).val( "" );
     63    $( '#template_' + id + '_form textarea' ).val( "" );
     64}
     65
    5766/**
    5867 * Creates a new template using AJAX
     
    7079        type:       "POST",
    7180        success:    function(data, textStatus, request) {
    72             hideTemplateForm( id );
     81            clearTemplateForm( id );
     82                        hideTemplateForm( id );
    7383            addTemplateListItem( data.id, data.html );
    7484        },
     
    236246
    237247/**
     248 * Clears the form to add a template field after adding one
     249 */
     250function clearTemplateFieldForm( id ) {
     251    $( '#templateField_' + id + '_form input#name' ).val( "" );
     252    $( '#templateField_' + id + '_form input#unit' ).val( "" );
     253    $( '#templateField_' + id + '_form input#required' ).attr( "checked", "" );
     254    $( '#templateField_' + id + '_form textarea' ).val( "" );
     255    $( '#templateField_' + id + '_form select' ).attr( 'selectedIndex', 0 );
     256    $( '#templateField_' + id + '_form .extra' ).hide();
     257}
     258
     259/**
    238260 * Adds a new template field using AJAX
    239261 */
     
    251273        type:       "POST",
    252274        success:    function(data, textStatus, request) {
     275            clearTemplateFieldForm( id );
    253276            hideTemplateFieldForm( id );
    254277            addFieldListItem( data.id, data.html );
Note: See TracChangeset for help on using the changeset viewer.