View Issue Details

IDProjectCategoryView StatusLast Update
05514Development Survey takingpublic2015-08-21 15:51
ReporterDenisChenuAssigned ToDenisChenu 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91+ 
Target Version2.05Fixed in Version2.05 
Summary05514: Remove prepareCellAdapters and cellAdapter for jquery
Description

In survey_runtime.js, we use cellAdaptater to check/uncheck checkbox and radio.

Sometimes, it make difficult to adapt some script for jquery.

Make this with jquery is more simple to adapt for another question type ( for example line in ul li).

Steps To Reproduce

To test the result:
http://limesurvey.sondages.pro/index.php?sid=1

Additional Information

remove 67 lines of javascript and replace with 5 lines

$(".question td").click(function(event){
if (event.target.nodeName !== 'INPUT') {
$(this).find("input:radio").click();
$(this).find("input:checkbox").click();
}

TagsNo tags attached.

Relationships

related to 04984 closedDenisChenu Development  Need more class for all question/answer part 
related to 07279 closedc_schmitz Bug reports Array exlude other function : user can change excluded option 

Activities

c_schmitz

c_schmitz

2011-10-18 17:35

administrator   ~16444

Tony, can you please check if this works fine and bugfree, especially with conditions (CI-version only).

DenisChenu

DenisChenu

2011-10-18 19:00

developer   ~16456

No, i made an error ....
I think we have to acces only to table.question

We have to put :

$("table.question td").click(function(event){
if (event.target.nodeName !== 'INPUT') {
$(this).find("input:radio").click();
$(this).find("input:checkbox").click();
}

But maybe we have to add a class to all td
.checkbox.answer_bloc, .radio.answer_bloc ( I like multi class ;))

DenisChenu

DenisChenu

2012-01-11 18:38

developer   ~16789

Last edited: 2012-01-11 18:38

View 2 revisions

Actually i have:
$(".question td").click(function(event){
if (event.target.nodeName !== 'INPUT' && event.target.nodeName !== 'LABEL') {
$(this).find("input.radio").click();
$(this).find("input.radio").triggerHandler("click");
$(this).find("input:checkbox").click();
$(this).find("input:checkbox").triggerHandler("click");
}
});
$(".answers li").click(function(event){
if (event.target.nodeName !== 'INPUT' && event.target.nodeName !== 'LABEL') {
$(this).find("input.radio").click();
$(this).find("input.radio").triggerHandler("click");
$(this).find("input.checkbox").click();
$(this).find("input.checkbox").triggerHandler("click");
}
});

Add triggerHandler("click"); for em funtion and some personnal script,
Add event.target.nodeName !== 'LABEL' for ul/li (but my template hav answers class for answer bloc.

I work for a global script for citronade v192

DenisChenu

DenisChenu

2012-03-17 19:32

developer   ~17981

Again another solution.

For 1.92:

function prepareCellAdapters(){
$('table.question td label').each(function(){
$(this).parent('td').css('padding','0');
$(this).width($(this).parent('td').innerWidth());
$(this).height($(this).parent('td').innerHeight());
$(this).css('display','table-cell');
$(this).css('padding','4px');
$(this).css('vertical-align','middle');
});
}

Here, i remove css padding before set width and height. But i think we have something best: the input color change when we are hover the td.

I think this label are to be removed ( they meen nothing), but if we done it, we can add it in JS
something like that:
$('table.question td > input').each(function(){
$(this).wrap('<label />');
}

I test actually, have some test to do for IE and for 'touch' screen.

DenisChenu

DenisChenu

2013-02-01 17:00

developer   ~23938

All can be made very easyly with

$.delegate .

But some issue with jquery1.4 and not in jquery1.9.

1.4 need triggerHandler and not 1.9 ...

DenisChenu

DenisChenu

2013-02-07 11:18

developer   ~23973

use $.delegate function and stopPropagation

Related Changesets

LimeSurvey: 2.1 114baa15

2013-02-07 10:14:24

DenisChenu

Details Diff
Dev: 05514: Remove prepareCellAdapters and cellAdapter for jquery
Dev: updated addClassEmpty too
Dev: use $.delegate function and stopPropagation
Affected Issues
05514
mod - scripts/survey_runtime.js Diff File

LimeSurvey: 2.05 9d8e52b5

2013-03-26 11:02:33

DenisChenu

Details Diff
Dev: 05514: Remove prepareCellAdapters and cellAdapter for jquery
Dev: Use same fix than 2.1
Affected Issues
05514
mod - scripts/survey_runtime.js Diff File

Issue History

Date Modified Username Field Change
2011-10-15 18:47 DenisChenu New Issue
2011-10-15 18:48 DenisChenu Project Bug reports => Development
2011-10-18 17:34 c_schmitz Assigned To => tpartner
2011-10-18 17:34 c_schmitz Status new => assigned
2011-10-18 17:35 c_schmitz Note Added: 16444
2011-10-18 19:00 DenisChenu Note Added: 16456
2011-10-23 15:54 DenisChenu Relationship added related to 04984
2012-01-11 18:38 DenisChenu Note Added: 16789
2012-01-11 18:38 DenisChenu Note Edited: 16789 View Revisions
2012-03-17 19:32 DenisChenu Note Added: 17981
2012-08-14 23:13 c_schmitz Assigned To tpartner => DenisChenu
2012-08-14 23:13 c_schmitz Target Version 1.91+ => 2.1
2013-02-01 17:00 DenisChenu Note Added: 23938
2013-02-07 11:18 DenisChenu Note Added: 23973
2013-02-07 11:18 DenisChenu Status assigned => closed
2013-02-07 11:18 DenisChenu Resolution open => fixed
2013-02-07 11:18 DenisChenu Fixed in Version => 2.1
2013-02-07 11:19 DenisChenu Changeset attached => LimeSurvey 2.1 114baa15
2013-02-07 17:43 DenisChenu Relationship added related to 07279
2013-03-25 22:18 DenisChenu Status closed => feedback
2013-03-25 22:18 DenisChenu Resolution fixed => reopened
2013-03-25 22:18 DenisChenu Fixed in Version 2.1 =>
2013-03-25 22:18 DenisChenu Target Version 2.1 => 2.05
2013-03-25 22:18 DenisChenu Status feedback => assigned
2013-03-26 12:03 DenisChenu Changeset attached => LimeSurvey 2.05 9d8e52b5
2013-03-26 12:03 DenisChenu Status assigned => resolved
2013-03-26 12:03 DenisChenu Fixed in Version => 2.05
2013-03-26 12:03 DenisChenu Resolution reopened => fixed
2015-08-21 15:51 c_schmitz Status resolved => closed