feed/assets/plugins/pokes/js/question.js
/*add a option more to question*/
add a option more to question
add a option more to question
function QuestObj(self){ 
  selft.removeClass('last');
  selft.parent().after('<p class="mb10"><input class="uiInput shareQuestionOption last" name="options[]" type="text" placeholder="+ '+__["Add an option"]+'..." /></p>'); 
 $('.shareQuestionOption.last').focus(function(){  selft = $(this); if(selft.hasClass('last')){  QuestObj(self); } });
 $('.shareQuestionOption.last').focus(function(){ if($(this).hasClass('active')) { return; } 
 if($(this).data('value') == undefined){ $(this).data('value', $(this).val()); } if($(this).val() == $(this).data('value')){ $(this).val(''); } if($(this).val() == ''){ $(this).addClass("active"); if($(this).hasClass('uiTextArea')){ $(this).parent().next().show(); } } });
 $('.shareQuestionOption.last').blur(function(){ if($(this).val() == ''){ $(this).val($(this).data('value')); $(this).removeClass("active"); if($(this).hasClass('uiTextArea') && !$(this).hasClass('shareNews')){ $(this).parent().next().hide(); } } });
 }
function QuestObj ( self ) { selft . removeClass ( 'last' ) ; selft . parent ( ) . after ( '<p class="mb10"><input class="uiInput shareQuestionOption last" name="options[]" type="text" placeholder="+ ' + __ [ "Add an option" ] + '..." /></p>' ) ; $ ( '.shareQuestionOption.last' ) . focus ( function ( ) { selft = $ ( this ) ; if ( selft . hasClass ( 'last' ) ) { QuestObj ( self ) ; } } ) ; $ ( '.shareQuestionOption.last' ) . focus ( function ( ) { if ( $ ( this ) . hasClass ( 'active' ) ) { return ; } if ( $ ( this ) . data ( 'value' ) == undefined ) { $ ( this ) . data ( 'value' , $ ( this ) . val ( ) ) ; } if ( $ ( this ) . val ( ) == $ ( this ) . data ( 'value' ) ) { $ ( this ) . val ( '' ) ; } if ( $ ( this ) . val ( ) == '' ) { $ ( this ) . addClass ( "active" ) ; if ( $ ( this ) . hasClass ( 'uiTextArea' ) ) { $ ( this ) . parent ( ) . next ( ) . show ( ) ; } } } ) ; $ ( '.shareQuestionOption.last' ) . blur ( function ( ) { if ( $ ( this ) . val ( ) == '' ) { $ ( this ) . val ( $ ( this ) . data ( 'value' ) ) ; $ ( this ) . removeClass ( "active" ) ; if ( $ ( this ) . hasClass ( 'uiTextArea' ) && ! $ ( this ) . hasClass ( 'shareNews' ) ) { $ ( this ) . parent ( ) . next ( ) . hide ( ) ; } } } ) ; }
add a option more to question
add a option more to question