Skip to content

Commit

Permalink
Dev Speed optimizations when browsing responses
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Dec 12, 2013
1 parent 95064f1 commit caedf5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/responses.php
Expand Up @@ -479,7 +479,7 @@ function browse($iSurveyID)
$question .=' (' . $fielddetails['subquestion1'] . ':' . $fielddetails['subquestion2'] . ')';
if (isset($fielddetails['scale_id']))
$question .='[' . $fielddetails['scale'] . ']';
$fnames[] = array($fielddetails['fieldname'], flattenText(stripJavaScript($question), true));
$fnames[] = array($fielddetails['fieldname'], flattenText($question,true));
}
elseif ($fielddetails['aid'] !== 'filecount')
{
Expand Down
3 changes: 1 addition & 2 deletions application/views/admin/responses/browseallrow_view.php
Expand Up @@ -6,8 +6,7 @@
{ ?>
<a href='<?php echo $this->createUrl("admin/dataentry/sa/editdata/subaction/edit/surveyid/{$surveyid}/id/{$dtrow['id']}"); ?>'><img src='<?php echo $sImageURL; ?>edit_16.png' alt='<?php $clang->eT('Edit this response'); ?>'/></a>
<?php }
if (hasFileUploadQuestion($surveyid))
{ ?>
if ($bHasFileUploadQuestion) { ?>
<a><img id='downloadfile_<?php echo $dtrow['id']; ?>' src='<?php echo $sImageURL; ?>down.png' alt='<?php $clang->eT('Download all files in this response as a zip file'); ?>' class='downloadfile'/></a>
<?php }
if (Permission::model()->hasSurveyPermission($surveyid, 'responses', 'delete'))
Expand Down
Expand Up @@ -71,7 +71,7 @@
}
?>
<th class='<?php echo $gbc; ?>'>
<strong><?php echo flattenText(stripJavaScript($fn[1]), true); ?></strong>
<strong><?php echo flattenText($fn[1], true); ?></strong>
</th>
<?php } ?>
</tr>
Expand Down

1 comment on commit caedf5f

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we have too long javascript issue

$(document).on('mouseenter','.browsetable th .questiontext',function(){
    if (!$(this).data('qtip') && !$(this)find("[data-hasqtip").length && $(this).text().length>10) {
        $(this).qtip({
            show: {
                ready: true // Need this so it shows on first event-fire
            },
            content: {
                text: function(api) {
                    return $(this).text();
                }
            },
            style: {
                classes: "qtip-light qtip-rounded"
            },
            position: {
                viewport: $(window),
                my: 'top right',
                at: 'bottom right',
                target: $(this).closest('th')
            }
        });
    }
});
$(document).on('mouseenter','.browsetable tbody td:gt(1)',function(){
    if (!$(this).data('qtip') && !$(this)find("[data-hasqtip").length && $(this).text().length>10) {
        $(this).qtip({
          show: {
             ready: true // Need this so it shows on first event-fire
          },
            content: {
                text: function(api) {
                    return $(this).text();
                }
            },
            style: {
                classes: "qtip-light qtip-rounded"
            },
            position: {
                viewport: $(window),
                my: 'top right',
                at: 'bottom right'
            }
        });
    }
});

Do some optimization, but with big table : there are again some js long issue ...

Please sign in to comment.