app/soc/content/js/survey-take-090705.js
changeset 2556 d1175010235e
parent 2552 747e058900d5
child 2557 cba50e22ff6b
equal deleted inserted replaced
2555:b7f14c803619 2556:d1175010235e
    17 *
    17 *
    18 * @author <a href="mailto:ajaksu@gmail.com">Daniel Diniz</a>
    18 * @author <a href="mailto:ajaksu@gmail.com">Daniel Diniz</a>
    19 * @author <a href="mailto:jamesalexanderlevy@gmail.com">James Levy</a>
    19 * @author <a href="mailto:jamesalexanderlevy@gmail.com">James Levy</a>
    20 */
    20 */
    21 
    21 
    22 (function ($) { 
    22 (function ($) {
    23   $(function () {
    23   $(function () {
    24   
    24 
    25     /*
    25     /*
    26     * == Setup Survey on Page Load ==
    26     * == Setup Survey on Page Load ==
    27     *
    27     *
    28     */
    28     */
    29 
    29 
    40 
    40 
    41       /*
    41       /*
    42       * == Set Custom Field Rules ==
    42       * == Set Custom Field Rules ==
    43       *
    43       *
    44       */
    44       */
    45       widget.find('input').each(
       
    46         function () {
       
    47           $(this).preserveDefaultText($(this).val());
       
    48         }
       
    49       );
       
    50 
       
    51       widget.find('textarea').each(
    45       widget.find('textarea').each(
    52         function () {
    46         function () {
    53           $(this).preserveDefaultText($(this).val()).attr('overflow', 'auto')
    47           $(this).attr('overflow', 'auto').growfield();
    54           .growfield();
       
    55         }
    48         }
    56       );
    49       );
    57     }
    50     }
    58 
    51 
    59     else { // survey has saved results
    52     else { // survey has saved results
   146         $('input#id_s_html').val(
   139         $('input#id_s_html').val(
   147           widget.find('div#survey_options').remove().end().html()
   140           widget.find('div#survey_options').remove().end().html()
   148         );
   141         );
   149       }
   142       }
   150     );
   143     );
   151   
   144 
   152    /*
   145    /*
   153    * == Customize Comment Appearance ==
   146    * == Customize Comment Appearance ==
   154    */
   147    */
   155    
   148 
   156    var comments = widget.find('td > .comment');
   149    var comments = widget.find('td > .comment');
   157    comments.each(function(){
   150    comments.each(function(){
   158      $(this).parents('tr:first')
   151      $(this).parents('tr:first')
   159            .css({'margin-top': '-10px', 'margin-bottom': '30px'})
   152            .css({'margin-top': '-10px', 'margin-bottom': '30px'})
   160            .prev().css({'margin-top': '-10px'})
   153            .prev().css({'margin-top': '-10px'})
   161            .find('label').css({'font-size': '11px'});
   154            .find('label').css({'font-size': '11px'});
   162    });
   155    });
   163     
   156 
   164   });
   157   });
   165 }(jQuery));
   158 }(jQuery));