Skip to content

Commit

Permalink
Merge pull request #13 from plitwin/master
Browse files Browse the repository at this point in the history
Replaced all instances of .size() with .length
123andy authored Nov 2, 2018
2 parents 17d392c + f336621 commit 38cb5a7
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion resources/imagemap/imageMapster.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions resources/inputmatrix.php
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@

// Search for a tr element with the id from the th cell
var real_tr = $("tr[sq_id='" + th_label + "']");
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Get the label
var real_label = $("td.labelrc:not(.quesnum):not(.questionnum)", $(real_tr));
// Move the label into the table and add a 'label' class for rendering
@@ -95,11 +95,11 @@

// Search for a tr element with the id from the td cell
var real_tr = $("tr[sq_id='" + td_label + "']");
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Get the input
//console.log('Found ' + td_label);
var trInputs = $(":input", $(real_tr));
if ($(trInputs).size()) {
if ($(trInputs).length) {
//console.log(trInputs);
var type = $(trInputs).prop('type');

10 changes: 5 additions & 5 deletions resources/shazam.php
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@

var real_tr = $("tr[sq_id='" + field + "']");
// Make sure field is present on page
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Check for label option
if (option == 'label') {
//Only copying the label
@@ -117,9 +117,9 @@
$(this).html($(real_label).clone()).addClass('shazam_label');
} else {
var real_data = $("td.data", $(real_tr));
if (! $(real_data).size()) real_data = $("td:first", $(real_tr));
if (! $(real_data).length) real_data = $("td:first", $(real_tr));
//var trInputs = $(":input", $(real_tr)).parentsUntil('td.data');
if ($(real_data).size()) {
if ($(real_data).length) {
var trInputs = $("input[type!='hidden']", $(real_data)).each(function() {
var type = $(this).prop('type');
//console.log ('Type: ' + type);
@@ -168,7 +168,7 @@
var real_tr = $("tr[sq_id='" + field + "']");

// Make sure field is present on page
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Do an initial sync of the visibilty
if ($(real_tr).is(':visible')) {
$(mirrored_element).show();
@@ -204,7 +204,7 @@
function getFieldLabel(field_name) {
// Search for a tr element with the id from the th cell
var real_tr = $("tr[sq_id='" + field_name + "']");
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Get the label
var real_label = $("td.labelrc:not(.quesnum):not(.questionnum) td:first", $(real_tr));
// Move the label into the table and add a 'label' class for rendering
10 changes: 5 additions & 5 deletions resources/shazam2.php
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@
// Find the 'real tr' for the field to be relocated
var real_tr = $("tr[sq_id='" + field + "']");
// Make sure field is present on page
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Check for label option
if (option == 'label') {
//Only copying the label
@@ -168,9 +168,9 @@
} else {
// MOVE IT
var real_data = $("td.data", $(real_tr));
if (! $(real_data).size()) real_data = $("td:last", $(real_tr)); // changed to last to handle left alignment
if (! $(real_data).length) real_data = $("td:last", $(real_tr)); // changed to last to handle left alignment
//var trInputs = $(":input", $(real_tr)).parentsUntil('td.data');
if ($(real_data).size()) {
if ($(real_data).length) {
var trInputs = $("input[type!='hidden']", $(real_data)).each(function() {
var type = $(this).prop('type');
//console.log ('Type: ' + type);
@@ -209,7 +209,7 @@
var real_tr = $("tr[sq_id='" + field + "']");

// Make sure field is present on page
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Do an initial sync of the visibilty
if ($(real_tr).is(':visible')) {
$(mirrored_element).show();
@@ -245,7 +245,7 @@
function getFieldLabel(field_name) {
// Search for a tr element with the id from the th cell
var real_tr = $("tr[sq_id='" + field_name + "']");
if ($(real_tr).size()) {
if ($(real_tr).length) {
// Get the label
var real_label = $("td.label:not(.quesnum):not(.questionnum) td:first", $(real_tr));
// Move the label into the table and add a 'label' class for rendering

0 comments on commit 38cb5a7

Please sign in to comment.