Browse Source

Fix #1586, remove deprecated use of $.size()

pull/1615/head
jlukic 10 years ago
parent
commit
23337483e3
18 changed files with 98 additions and 98 deletions
  1. 2
      src/definitions/behaviors/api.js
  2. 28
      src/definitions/behaviors/form.js
  3. 10
      src/definitions/behaviors/visit.js
  4. 4
      src/definitions/globals/site.js
  5. 2
      src/definitions/modules/accordion.js
  6. 6
      src/definitions/modules/checkbox.js
  7. 10
      src/definitions/modules/dimmer.js
  8. 36
      src/definitions/modules/dropdown.js
  9. 12
      src/definitions/modules/modal.js
  10. 8
      src/definitions/modules/popup.js
  11. 10
      src/definitions/modules/rating.js
  12. 16
      src/definitions/modules/search.js
  13. 12
      src/definitions/modules/shape.js
  14. 16
      src/definitions/modules/sidebar.js
  15. 4
      src/definitions/modules/sticky.js
  16. 8
      src/definitions/modules/tab.js
  17. 8
      src/definitions/modules/transition.js
  18. 4
      src/definitions/modules/video.js

2
src/definitions/behaviors/api.js

@ -198,7 +198,7 @@ $.api = $.fn.api = function(parameters) {
is: {
disabled: function() {
return ($module.filter(settings.filter).size() > 0);
return ($module.filter(settings.filter).length > 0);
},
loading: function() {
return (module.request && module.request.state() == 'pending');

28
src/definitions/behaviors/form.js

@ -161,7 +161,7 @@ $.fn.form = function(fields, parameters) {
.blur()
;
}
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).size() > 0 ) {
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).length > 0 ) {
module.debug('Enter key pressed, submitting form');
$submit
.addClass(className.down)
@ -222,13 +222,13 @@ $.fn.form = function(fields, parameters) {
},
field: function(identifier) {
module.verbose('Finding field with identifier', identifier);
if( $field.filter('#' + identifier).size() > 0 ) {
if( $field.filter('#' + identifier).length > 0 ) {
return $field.filter('#' + identifier);
}
else if( $field.filter('[name="' + identifier +'"]').size() > 0 ) {
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
return $field.filter('[name="' + identifier +'"]');
}
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').size() > 0 ) {
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').length > 0 ) {
return $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]');
}
return $('<input/>');
@ -250,13 +250,13 @@ $.fn.form = function(fields, parameters) {
field: function(identifier) {
module.verbose('Checking for existence of a field with identifier', identifier);
if( $field.filter('#' + identifier).size() > 0 ) {
if( $field.filter('#' + identifier).length > 0 ) {
return true;
}
else if( $field.filter('[name="' + identifier +'"]').size() > 0 ) {
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
return true;
}
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').size() > 0 ) {
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').length > 0 ) {
return true;
}
return false;
@ -270,7 +270,7 @@ $.fn.form = function(fields, parameters) {
$field = module.get.field(identifier),
$fieldGroup = $field.closest($group),
$prompt = $fieldGroup.find(selector.prompt),
promptExists = ($prompt.size() !== 0)
promptExists = ($prompt.length !== 0)
;
errors = (typeof errors == 'string')
? [errors]
@ -539,8 +539,8 @@ $.fn.form = function(fields, parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
@ -707,7 +707,7 @@ $.fn.form.settings = {
// checkbox checked
checked: function() {
return ($(this).filter(':checked').size() > 0);
return ($(this).filter(':checked').length > 0);
},
// value contains (text)
@ -781,13 +781,13 @@ $.fn.form.settings = {
$form = $(this),
matchingValue
;
if($form.find('#' + fieldIdentifier).size() > 0) {
if($form.find('#' + fieldIdentifier).length > 0) {
matchingValue = $form.find('#' + fieldIdentifier).val();
}
else if($form.find('[name="' + fieldIdentifier +'"]').size() > 0) {
else if($form.find('[name="' + fieldIdentifier +'"]').length > 0) {
matchingValue = $form.find('[name="' + fieldIdentifier + '"]').val();
}
else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').size() > 0 ) {
else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').length > 0 ) {
matchingValue = $form.find('[data-validate="'+ fieldIdentifier +'"]').val();
}
return (matchingValue !== undefined)

10
src/definitions/behaviors/visit.js

@ -197,9 +197,9 @@ $.visit = $.fn.visit = function(parameters) {
var
$element = $(selector)
;
if($element.size() > 0 && !$.isWindow($element[0])) {
if($element.length > 0 && !$.isWindow($element[0])) {
module.debug('Updating visit count for element', $element);
$displays = ($displays.size() > 0)
$displays = ($displays.length > 0)
? $displays.add($element)
: $element
;
@ -245,7 +245,7 @@ $.visit = $.fn.visit = function(parameters) {
update: {
display: function(value) {
value = value || module.get.count();
if($displays.size() > 0) {
if($displays.length > 0) {
module.debug('Updating displayed view count', $displays);
$displays.html(value);
}
@ -379,8 +379,8 @@ $.visit = $.fn.visit = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

4
src/definitions/globals/site.js

@ -150,7 +150,7 @@ $.site = $.fn.site = function(parameters) {
$.fn[name].settings[setting] = value;
if(modifyExisting && namespace) {
$existingModules = $(':data(module-' + namespace + ')');
if($existingModules.size() > 0) {
if($existingModules.length > 0) {
module.verbose('Modifying existing settings', $existingModules);
$existingModules[name]('setting', setting, value);
}
@ -176,7 +176,7 @@ $.site = $.fn.site = function(parameters) {
$.extend(true, $.fn[name].settings, newSettings);
if(modifyExisting && namespace) {
$existingModules = $(':data(module-' + namespace + ')');
if($existingModules.size() > 0) {
if($existingModules.length > 0) {
module.verbose('Modifying existing settings', $existingModules);
$existingModules[name]('setting', newSettings);
}

2
src/definitions/modules/accordion.js

@ -268,7 +268,7 @@ $.fn.accordion = function(parameters) {
$openTitles = $openTitles.not($nestedTitles);
$openContents = $openTitles.next($content);
}
if( ($openTitles.size() > 0) ) {
if( ($openTitles.length > 0) ) {
module.debug('Exclusive enabled, closing other content', $openTitles);
$openTitles
.removeClass(className.active)

6
src/definitions/modules/checkbox.js

@ -120,7 +120,7 @@ $.fn.checkbox = function(parameters) {
? module[event]
: module.toggle
;
if($element.size() > 0) {
if($element.length > 0) {
module.debug('Attaching checkbox events to element', selector, event);
$element
.on('click' + eventNamespace, event)
@ -193,7 +193,7 @@ $.fn.checkbox = function(parameters) {
create: {
label: function() {
if($input.prevAll(selector.label).size() > 0) {
if($input.prevAll(selector.label).length > 0) {
$input.prev(selector.label).detach().insertAfter($input);
module.debug('Moving existing label', $label);
}
@ -206,7 +206,7 @@ $.fn.checkbox = function(parameters) {
has: {
label: function() {
return ($label.size() > 0);
return ($label.length > 0);
}
},

10
src/definitions/modules/dimmer.js

@ -129,7 +129,7 @@ $.fn.dimmer = function(parameters) {
event: {
click: function(event) {
module.verbose('Determining if event occured on dimmer', event);
if( $dimmer.find(event.target).size() === 0 || $(event.target).is(selector.content) ) {
if( $dimmer.find(event.target).length === 0 || $(event.target).is(selector.content) ) {
module.hide();
event.stopImmediatePropagation();
}
@ -303,10 +303,10 @@ $.fn.dimmer = function(parameters) {
has: {
dimmer: function() {
if(settings.dimmerName) {
return ($module.children(selector.dimmer).filter('.' + settings.dimmerName).size() > 0);
return ($module.children(selector.dimmer).filter('.' + settings.dimmerName).length > 0);
}
else {
return ( $module.children(selector.dimmer).size() > 0 );
return ( $module.children(selector.dimmer).length > 0 );
}
}
},
@ -473,8 +473,8 @@ $.fn.dimmer = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

36
src/definitions/modules/dropdown.js

@ -51,7 +51,7 @@ $.fn.dropdown = function(parameters) {
$search = $module.find(selector.search),
$input = $module.find(selector.input),
$combo = ($module.prev().find(selector.text).size() > 0)
$combo = ($module.prev().find(selector.text).length > 0)
? $module.prev().find(selector.text)
: $module.prev(),
@ -170,10 +170,10 @@ $.fn.dropdown = function(parameters) {
module.debug('Dropdown initialized on a select', selectValues);
// see if select exists inside a dropdown
$input = $module;
if($input.parents(selector.dropdown).size() > 0) {
if($input.parents(selector.dropdown).length > 0) {
module.debug('Creating dropdown menu only from template');
$module = $input.closest(selector.dropdown);
if($module.find('.' + className.dropdown).size() === 0) {
if($module.find('.' + className.dropdown).length === 0) {
$('<div />')
.addClass(className.menu)
.html( settings.templates.menu( selectValues ))
@ -469,14 +469,14 @@ $.fn.dropdown = function(parameters) {
},
selectedClass = className.selected,
currentIndex = $visibleItems.index( $selectedItem ),
hasSelectedItem = ($selectedItem.size() > 0),
hasSelectedItem = ($selectedItem.length > 0),
$nextItem,
newIndex
;
// default to activated choice if no selection present
if(!hasSelectedItem) {
$selectedItem = $item.filter('.' + className.active).eq(0);
hasSelectedItem = ($selectedItem.size() > 0);
hasSelectedItem = ($selectedItem.length > 0);
}
// close shortcuts
if(pressedKey == keys.escape) {
@ -522,7 +522,7 @@ $.fn.dropdown = function(parameters) {
else {
$nextItem = $selectedItem.nextAll(selector.item + ':not(.' + className.filtered + ')').eq(0);
}
if(currentIndex + 1 < $visibleItems.size() ) {
if(currentIndex + 1 < $visibleItems.length ) {
module.verbose('Down key pressed, changing active item');
$item
.removeClass(selectedClass)
@ -577,7 +577,7 @@ $.fn.dropdown = function(parameters) {
$currentMenu = $(this).children(selector.menu),
$otherMenus = $(this).siblings(selector.item).children(selector.menu)
;
if( $currentMenu.size() > 0 ) {
if( $currentMenu.length > 0 ) {
clearTimeout(module.itemTimer);
module.itemTimer = setTimeout(function() {
$.each($otherMenus, function() {
@ -594,7 +594,7 @@ $.fn.dropdown = function(parameters) {
var
$currentMenu = $(this).children(selector.menu)
;
if($currentMenu.size() > 0) {
if($currentMenu.length > 0) {
clearTimeout(module.itemTimer);
module.itemTimer = setTimeout(function() {
module.verbose('Hiding sub-menu', $currentMenu);
@ -614,8 +614,8 @@ $.fn.dropdown = function(parameters) {
module.remove.searchTerm();
module.determine.selectAction(text, value);
},
openingSubMenu = ($subMenu.size() > 0),
isSubItem = ($subMenu.find($target).size() > 0)
openingSubMenu = ($subMenu.length > 0),
isSubItem = ($subMenu.find($target).length > 0)
;
if(isSubItem) {
return false;
@ -653,7 +653,7 @@ $.fn.dropdown = function(parameters) {
? callback
: function(){}
;
if( $(event.target).closest($module).size() === 0 ) {
if( $(event.target).closest($module).length === 0 ) {
module.verbose('Triggering event', callback);
callback();
return true;
@ -668,7 +668,7 @@ $.fn.dropdown = function(parameters) {
? callback
: function(){}
;
if( $(event.target).closest($menu).size() === 0 ) {
if( $(event.target).closest($menu).length === 0 ) {
module.verbose('Triggering event', callback);
callback();
return true;
@ -733,7 +733,7 @@ $.fn.dropdown = function(parameters) {
return $text.text();
},
value: function() {
return ($input.size() > 0)
return ($input.length > 0)
? $input.val()
: $module.data(metadata.value)
;
@ -744,7 +744,7 @@ $.fn.dropdown = function(parameters) {
: settings.preserveHTML
;
if($choice !== undefined) {
if($choice.find(selector.menu).size() > 0) {
if($choice.find(selector.menu).length > 0) {
module.verbose('Retreiving text of element with sub-menu');
$choice = $choice.clone();
$choice.find(selector.menu).remove();
@ -970,7 +970,7 @@ $.fn.dropdown = function(parameters) {
;
$item = $item || module.get.activeItem();
hasActive = ($item && $item.size() > 0);
hasActive = ($item && $item.length > 0);
forceScroll = (forceScroll !== undefined)
? forceScroll
: false
@ -1025,7 +1025,7 @@ $.fn.dropdown = function(parameters) {
},
value: function(value) {
module.debug('Adding selected value to hidden input', value, $input);
if($input.size() > 0) {
if($input.length > 0) {
$input
.val(value)
.trigger('change')
@ -1117,7 +1117,7 @@ $.fn.dropdown = function(parameters) {
;
},
allFiltered: function() {
return ($item.filter('.' + className.filtered).size() === $item.size());
return ($item.filter('.' + className.filtered).length === $item.length);
},
hidden: function($subMenu) {
return ($subMenu)
@ -1129,7 +1129,7 @@ $.fn.dropdown = function(parameters) {
return $module.hasClass(className.search);
},
searchable: function() {
return ($search.size() > 0);
return ($search.length > 0);
},
searchSelection: function() {
return ( module.is.searchable() && $search.parent().is($module) );

12
src/definitions/modules/modal.js

@ -172,7 +172,7 @@ $.fn.modal = function(parameters) {
? module[event]
: module.toggle
;
if($toggle.size() > 0) {
if($toggle.length > 0) {
module.debug('Attaching modal events to element', selector, event);
$toggle
.off(eventNamespace)
@ -225,7 +225,7 @@ $.fn.modal = function(parameters) {
}
},
click: function(event) {
if( $(event.target).closest($module).size() === 0 ) {
if( $(event.target).closest($module).length === 0 ) {
module.debug('Dimmer clicked, hiding all modals');
if( module.is.active() ) {
module.remove.clickaway();
@ -306,7 +306,7 @@ $.fn.modal = function(parameters) {
module.set.type();
module.set.clickaway();
if( !settings.allowMultiple && $otherModals.filter(':visible').size() > 0) {
if( !settings.allowMultiple && $otherModals.filter(':visible').length > 0) {
module.debug('Other modals visible, queueing show animation');
module.hideOthers(module.showModal);
}
@ -455,7 +455,7 @@ $.fn.modal = function(parameters) {
},
othersActive: function() {
return ($otherModals.filter('.' + className.active).size() > 0);
return ($otherModals.filter('.' + className.active).length > 0);
},
add: {
@ -475,7 +475,7 @@ $.fn.modal = function(parameters) {
restore: {
focus: function() {
if($focusedElement && $focusedElement.size() > 0) {
if($focusedElement && $focusedElement.length > 0) {
$focusedElement.focus();
}
}
@ -559,7 +559,7 @@ $.fn.modal = function(parameters) {
var
$inputs = $module.find(':input:visible'),
$autofocus = $inputs.filter('[autofocus]'),
$input = ($autofocus.size() > 0)
$input = ($autofocus.length > 0)
? $autofocus
: $inputs
;

8
src/definitions/modules/popup.js

@ -233,7 +233,7 @@ $.fn.popup = function(parameters) {
}
$.proxy(settings.onCreate, $popup)(element);
}
else if($target.next(settings.selector.popup).size() !== 0) {
else if($target.next(settings.selector.popup).length !== 0) {
module.verbose('Pre-existing popup found, reverting to inline');
settings.inline = true;
module.refresh();
@ -296,7 +296,7 @@ $.fn.popup = function(parameters) {
hideGracefully: function(event) {
// don't close on clicks inside popup
if(event && $(event.target).closest(selector.popup).size() === 0) {
if(event && $(event.target).closest(selector.popup).length === 0) {
module.debug('Click occurred outside popup hiding popup');
module.hide();
}
@ -313,7 +313,7 @@ $.fn.popup = function(parameters) {
return ( module.has.popup() );
}
else {
return ( $popup.closest($context).size() > 1 )
return ( $popup.closest($context).length > 1 )
? true
: false
;
@ -787,7 +787,7 @@ $.fn.popup = function(parameters) {
has: {
popup: function() {
return ($popup.size() > 0);
return ($popup.length > 0);
}
},

10
src/definitions/modules/rating.js

@ -56,7 +56,7 @@ $.fn.rating = function(parameters) {
initialize: function() {
module.verbose('Initializing rating module', settings);
if($icon.size() === 0) {
if($icon.length === 0) {
module.setup.layout();
}
@ -144,7 +144,7 @@ $.fn.rating = function(parameters) {
currentRating = module.getRating(),
rating = $icon.index($activeIcon) + 1,
canClear = (settings.clearable == 'auto')
? ($icon.size() === 1)
? ($icon.length === 1)
: settings.clearable
;
if(canClear && currentRating == rating) {
@ -163,7 +163,7 @@ $.fn.rating = function(parameters) {
getRating: function() {
var
currentRating = $icon.filter('.' + className.active).size()
currentRating = $icon.filter('.' + className.active).length
;
module.verbose('Current rating retrieved', currentRating);
return currentRating;
@ -301,8 +301,8 @@ $.fn.rating = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

16
src/definitions/modules/search.js

@ -147,7 +147,7 @@ $.fn.search = function(parameters) {
},
activeClass = className.active,
currentIndex = $result.index( $result.filter('.' + activeClass) ),
resultSize = $result.size(),
resultSize = $result.length,
newIndex
;
// search shortcuts
@ -158,10 +158,10 @@ $.fn.search = function(parameters) {
;
}
// result shortcuts
if($results.filter(':visible').size() > 0) {
if($results.filter(':visible').length > 0) {
if(keyCode == keys.enter) {
module.verbose('Enter key pressed, selecting active result');
if( $result.filter('.' + activeClass).size() > 0 ) {
if( $result.filter('.' + activeClass).length > 0 ) {
$.proxy(module.results.select, $result.filter('.' + activeClass) )(event);
event.preventDefault();
return false;
@ -402,7 +402,7 @@ $.fn.search = function(parameters) {
module.results.show();
},
show: function() {
if( ($results.filter(':visible').size() === 0) && ($prompt.filter(':focus').size() > 0) && $results.html() !== '') {
if( ($results.filter(':visible').length === 0) && ($prompt.filter(':focus').length > 0) && $results.html() !== '') {
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is inward')) {
module.debug('Showing results with css animations');
$results
@ -424,7 +424,7 @@ $.fn.search = function(parameters) {
}
},
hide: function() {
if($results.filter(':visible').size() > 0) {
if($results.filter(':visible').length > 0) {
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is outward')) {
module.debug('Hiding results with css animations');
$results
@ -458,7 +458,7 @@ $.fn.search = function(parameters) {
$title = $result.find(selector.title).eq(0),
href = $link.attr('href') || false,
target = $link.attr('target') || false,
name = ($title.size() > 0)
name = ($title.length > 0)
? $title.text()
: false
;
@ -569,8 +569,8 @@ $.fn.search = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

12
src/definitions/modules/shape.js

@ -189,7 +189,7 @@ $.fn.shape = function(parameters) {
defaultSide: function() {
$activeSide = $module.find('.' + settings.className.active);
$nextSide = ( $activeSide.next(selector.side).size() > 0 )
$nextSide = ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
@ -222,7 +222,7 @@ $.fn.shape = function(parameters) {
$activeSide = $clone.find('.' + settings.className.active),
$nextSide = (nextIndex)
? $clone.find(selector.side).eq(nextIndex)
: ( $activeSide.next(selector.side).size() > 0 )
: ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $clone.find(selector.side).first(),
newSize = {}
@ -245,7 +245,7 @@ $.fn.shape = function(parameters) {
nextIndex = selector;
$nextSide = $side.filter(selector);
nextIndex = $side.index($nextSide);
if($nextSide.size() === 0) {
if($nextSide.length === 0) {
module.set.defaultSide();
module.error(error.side);
}
@ -458,7 +458,7 @@ $.fn.shape = function(parameters) {
},
nextSide: function() {
return ( $activeSide.next(selector.side).size() > 0 )
return ( $activeSide.next(selector.side).length > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
@ -683,8 +683,8 @@ $.fn.shape = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

16
src/definitions/modules/sidebar.js

@ -129,7 +129,7 @@ $.fn.sidebar = function(parameters) {
event: {
clickaway: function(event) {
if( $(event.target).closest(selector.sidebar).size() === 0 ) {
if( $(event.target).closest(selector.sidebar).length === 0 ) {
module.verbose('User clicked on dimmed page');
module.hide();
}
@ -146,7 +146,7 @@ $.fn.sidebar = function(parameters) {
}
},
scroll: function(event) {
if( $(event.target).closest(selector.sidebar).size() === 0 ) {
if( $(event.target).closest(selector.sidebar).length === 0 ) {
event.preventDefault();
}
}
@ -287,7 +287,7 @@ $.fn.sidebar = function(parameters) {
setup: {
layout: function() {
if( $context.children(selector.pusher).size() === 0 ) {
if( $context.children(selector.pusher).length === 0 ) {
module.debug('Adding wrapper element for sidebar');
module.error(error.pusher);
$pusher = $('<div class="pusher" />');
@ -299,7 +299,7 @@ $.fn.sidebar = function(parameters) {
;
module.refresh();
}
if($module.nextAll(selector.pusher).size() === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
if($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
module.debug('Moved sidebar to correct parent element');
module.error(error.movedSidebar, element);
$module.detach().prependTo($context);
@ -318,7 +318,7 @@ $.fn.sidebar = function(parameters) {
? module[event]
: module.toggle
;
if($toggle.size() > 0) {
if($toggle.length > 0) {
module.debug('Attaching sidebar events to element', selector, event);
$toggle
.on('click' + eventNamespace, event)
@ -387,14 +387,14 @@ $.fn.sidebar = function(parameters) {
},
othersVisible: function() {
return ($sidebars.not($module).filter('.' + className.visible).size() > 0);
return ($sidebars.not($module).filter('.' + className.visible).length > 0);
},
hideOthers: function(callback) {
var
$otherSidebars = $sidebars.not($module).filter('.' + className.visible),
callback = callback || function(){},
sidebarCount = $otherSidebars.size(),
sidebarCount = $otherSidebars.length,
callbackCount = 0
;
$otherSidebars
@ -613,7 +613,7 @@ $.fn.sidebar = function(parameters) {
bodyCSS: function() {
module.debug('Removing body css styles', $style);
if($style.size() > 0) {
if($style.length > 0) {
$style.remove();
}
},

4
src/definitions/modules/sticky.js

@ -68,7 +68,7 @@ $.fn.sticky = function(parameters) {
else {
$context = $container;
}
if($context.size() === 0) {
if($context.length === 0) {
module.error(error.invalidContext, settings.context, $module);
return;
}
@ -226,7 +226,7 @@ $.fn.sticky = function(parameters) {
}
};
module.set.containerSize();
module.set.size();
module.set.length;
module.stick();
module.debug('Caching element positions', module.cache);
}

8
src/definitions/modules/tab.js

@ -98,7 +98,7 @@ $.fn.tab = function(parameters) {
// determine tab context
if(settings.context === 'parent') {
if($module.closest(selector.ui).size() > 0) {
if($module.closest(selector.ui).length > 0) {
$reference = $module.closest(selector.ui);
module.verbose('Using closest UI element for determining parent', $reference);
}
@ -319,7 +319,7 @@ $.fn.tab = function(parameters) {
currentPath = $anchor.closest('[data-tab]').data('tab');
$tab = module.get.tabElement(currentPath);
// if anchor exists use parent tab
if($anchor && $anchor.size() > 0 && currentPath) {
if($anchor && $anchor.length > 0 && currentPath) {
module.debug('No tab found, but deep anchor link present, opening parent tab');
module.activate.all(currentPath);
if( !module.cache.read(currentPath) ) {
@ -451,7 +451,7 @@ $.fn.tab = function(parameters) {
is: {
tab: function(tabName) {
return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
? ( module.get.tabElement(tabName).length > 0 )
: false
;
}
@ -503,7 +503,7 @@ $.fn.tab = function(parameters) {
lastTab = module.utilities.last(tabPathArray);
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + lastTab + '"]');
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
return ($fullPathTab.size() > 0)
return ($fullPathTab.length > 0)
? $fullPathTab
: $simplePathTab
;

8
src/definitions/modules/transition.js

@ -111,7 +111,7 @@ $.fn.transition = function() {
$parentElement = $module.parent(),
$nextElement = $module.next()
;
if($nextElement.size() === 0) {
if($nextElement.length === 0) {
$module.detach().appendTo($parentElement);
}
else {
@ -635,7 +635,7 @@ $.fn.transition = function() {
occuring: function(animation) {
animation = animation || settings.animation;
animation = animation.replace(' ', '.');
return ( $module.filter(animation).size() > 0 );
return ( $module.filter(animation).length > 0 );
},
visible: function() {
return $module.is(':visible');
@ -766,8 +766,8 @@ $.fn.transition = function() {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

4
src/definitions/modules/video.js

@ -366,8 +366,8 @@ $.fn.video = function(parameters) {
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);

Loading…
Cancel
Save