Browse Source

Fix all the linting errors i forgot to check

pull/2169/head
jlukic 9 years ago
parent
commit
b3612b2792
6 changed files with 23 additions and 21 deletions
  1. 29
      src/definitions/modules/dropdown.js
  2. 2
      src/definitions/modules/modal.js
  3. 4
      src/definitions/modules/popup.js
  4. 3
      src/definitions/modules/search.js
  5. 2
      src/definitions/modules/tab.js
  6. 4
      src/definitions/modules/transition.js

29
src/definitions/modules/dropdown.js

@ -689,7 +689,6 @@ $.fn.dropdown = function(parameters) {
$range = ($nextActive.length > 0) $range = ($nextActive.length > 0)
? $label.nextUntil($nextActive).add($activeLabels).add($label) ? $label.nextUntil($nextActive).add($activeLabels).add($label)
: $label.prevUntil($prevActive).add($activeLabels).add($label) : $label.prevUntil($prevActive).add($activeLabels).add($label)
;
; ;
if(event.shiftKey) { if(event.shiftKey) {
$activeLabels.removeClass(className.active); $activeLabels.removeClass(className.active);
@ -819,12 +818,12 @@ $.fn.dropdown = function(parameters) {
labelCount = $label.length, labelCount = $label.length,
hasActiveLabel = ($activeLabel.length > 0), hasActiveLabel = ($activeLabel.length > 0),
hasMultipleActive = ($activeLabel.length > 1), hasMultipleActive = ($activeLabel.length > 1),
isFirstLabel = (labelIndex == 0),
isFirstLabel = (labelIndex === 0),
isLastLabel = (labelIndex + 1 == labelCount), isLastLabel = (labelIndex + 1 == labelCount),
isSearch = module.is.searchSelection(), isSearch = module.is.searchSelection(),
isFocusedOnSearch = module.is.focusedOnSearch(), isFocusedOnSearch = module.is.focusedOnSearch(),
isFocused = module.is.focused(), isFocused = module.is.focused(),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() == 0),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() === 0),
$nextLabel $nextLabel
; ;
if(settings.allowAdditions && isFocusedOnSearch && (pressedKey == keys.delimiter)) { if(settings.allowAdditions && isFocusedOnSearch && (pressedKey == keys.delimiter)) {
@ -840,7 +839,7 @@ $.fn.dropdown = function(parameters) {
else if(hasActiveLabel) { else if(hasActiveLabel) {
if(!event.shiftKey) { if(!event.shiftKey) {
module.verbose('Selecting previous label'); module.verbose('Selecting previous label');
$label.removeClass(className.active)
$label.removeClass(className.active);
} }
else { else {
module.verbose('Adding previous label to selection'); module.verbose('Adding previous label to selection');
@ -866,7 +865,7 @@ $.fn.dropdown = function(parameters) {
if(hasActiveLabel) { if(hasActiveLabel) {
if(!event.shiftKey) { if(!event.shiftKey) {
module.verbose('Selecting next label'); module.verbose('Selecting next label');
$label.removeClass(className.active)
$label.removeClass(className.active);
} }
else { else {
module.verbose('Adding next label to selection'); module.verbose('Adding next label to selection');
@ -1108,7 +1107,7 @@ $.fn.dropdown = function(parameters) {
? callback ? callback
: function(){} : function(){}
; ;
if($target.closest($menu).length == 0) {
if($target.closest($menu).length === 0) {
module.verbose('Triggering event', callback); module.verbose('Triggering event', callback);
callback(); callback();
return true; return true;
@ -1213,7 +1212,7 @@ $.fn.dropdown = function(parameters) {
var var
value = module.get.value() value = module.get.value()
; ;
if(value == '') {
if(value === '') {
return ''; return '';
} }
return (!$input.is('select') && module.is.multiple()) return (!$input.is('select') && module.is.multiple())
@ -1444,10 +1443,10 @@ $.fn.dropdown = function(parameters) {
: '', : '',
hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0), hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0),
searchWidth = (searchValue.length * settings.glyphWidth) + 'em', searchWidth = (searchValue.length * settings.glyphWidth) + 'em',
valueIsSet = $input.val() != ''
valueIsSet = $input.val() !== ''
; ;
if(isMultiple && hasSearchValue) { if(isMultiple && hasSearchValue) {
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth)
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
$search.css('width', searchWidth); $search.css('width', searchWidth);
} }
if(hasSearchValue || (isSearchMultiple && valueIsSet)) { if(hasSearchValue || (isSearchMultiple && valueIsSet)) {
@ -1649,7 +1648,7 @@ $.fn.dropdown = function(parameters) {
} }
else { else {
module.set.value(selectedValue, selectedText, $selected); module.set.value(selectedValue, selectedText, $selected);
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
$selected.addClass(className.active); $selected.addClass(className.active);
} }
} }
@ -1685,7 +1684,7 @@ $.fn.dropdown = function(parameters) {
if(settings.label.variation) { if(settings.label.variation) {
$label.addClass(settings.label.variation); $label.addClass(settings.label.variation);
} }
if(shouldAnimate == true) {
if(shouldAnimate === true) {
module.debug('Animating in label', $label); module.debug('Animating in label', $label);
$label $label
.addClass(className.hidden) .addClass(className.hidden)
@ -1792,7 +1791,7 @@ $.fn.dropdown = function(parameters) {
module.remove.label(selectedValue); module.remove.label(selectedValue);
} }
else { else {
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
} }
} }
$selectedItem $selectedItem
@ -1843,7 +1842,7 @@ $.fn.dropdown = function(parameters) {
}, },
labels: function($activeLabels) { labels: function($activeLabels) {
$activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active); $activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active);
module.verbose('Removing active labels', $activeLabels);
module.verbose('Removing active label selections', $activeLabels);
$activeLabels $activeLabels
.each(function(){ .each(function(){
module.remove.selected($(this).data('value')); module.remove.selected($(this).data('value'));
@ -1946,7 +1945,7 @@ $.fn.dropdown = function(parameters) {
return $module.hasClass(className.search); return $module.hasClass(className.search);
}, },
searchSelection: function() { searchSelection: function() {
return ( module.has.search() && $search.closest(selector.menu).length == 0 );
return ( module.has.search() && $search.closest(selector.menu).length === 0 );
}, },
selection: function() { selection: function() {
return $module.hasClass(className.selection); return $module.hasClass(className.selection);
@ -2364,7 +2363,7 @@ $.fn.dropdown.settings = {
/* Callbacks */ /* Callbacks */
onLabelSelect : function($selectedLabels){}, onLabelSelect : function($selectedLabels){},
onNoResults : function(searchTerm) { return true },
onNoResults : function(searchTerm) { return true; },
onChange : function(value, text, $selected){}, onChange : function(value, text, $selected){},
onShow : function(){}, onShow : function(){},
onHide : function(){}, onHide : function(){},

2
src/definitions/modules/modal.js

@ -108,7 +108,7 @@ $.fn.modal = function(parameters) {
; ;
if(settings.inverted) { if(settings.inverted) {
dimmerSettings.variation = (dimmerSettings.variation !== undefined) dimmerSettings.variation = (dimmerSettings.variation !== undefined)
? dimmer.settings.variation + ' inverted'
? dimmerSettings.variation + ' inverted'
: 'inverted' : 'inverted'
; ;
} }

4
src/definitions/modules/popup.js

@ -600,7 +600,7 @@ $.fn.popup = function(parameters) {
position: function(position, arrowOffset) { position: function(position, arrowOffset) {
// exit conditions // exit conditions
if($target.length == 0 || $popup.length == 0) {
if($target.length === 0 || $popup.length === 0) {
module.error(error.notFound); module.error(error.notFound);
return; return;
} }
@ -641,7 +641,7 @@ $.fn.popup = function(parameters) {
position = position || $module.data(metadata.position) || settings.position; position = position || $module.data(metadata.position) || settings.position;
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset; arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset;
if(target.top == 0 && target.left == 0) {
if(target.top === 0 && target.left === 0) {
module.debug('Popup target is hidden, no action taken'); module.debug('Popup target is hidden, no action taken');
return false; return false;
} }

3
src/definitions/modules/search.js

@ -550,6 +550,9 @@ $.fn.search = function(parameters) {
clear: { clear: {
cache: function(value) { cache: function(value) {
var
cache = $module.data(metadata.cache)
;
if(!value) { if(!value) {
module.debug('Clearing cache', value); module.debug('Clearing cache', value);
$module.removeData(metadata.cache); $module.removeData(metadata.cache);

2
src/definitions/modules/tab.js

@ -331,7 +331,7 @@ $.fn.tab = function(parameters) {
} }
else if(tabPath.search('/') == -1 && tabPath !== '') { else if(tabPath.search('/') == -1 && tabPath !== '') {
// look for in page anchor // look for in page anchor
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
currentPath = $anchor.closest('[data-tab]').data('tab'); currentPath = $anchor.closest('[data-tab]').data('tab');
$tab = module.get.tabElement(currentPath); $tab = module.get.tabElement(currentPath);
// if anchor exists use parent tab // if anchor exists use parent tab

4
src/definitions/modules/transition.js

@ -437,7 +437,7 @@ $.fn.transition = function() {
module.remove.completeCallback(); module.remove.completeCallback();
}, },
queueCallback: function() { queueCallback: function() {
$module.off('.queue' + eventNamespace)
$module.off('.queue' + eventNamespace);
}, },
completeCallback: function() { completeCallback: function() {
$module.off('.complete' + eventNamespace); $module.off('.complete' + eventNamespace);
@ -769,7 +769,7 @@ $.fn.transition = function() {
clear: { clear: {
queue: function() { queue: function() {
module.debug('Clearing animation queue')
module.debug('Clearing animation queue');
module.remove.queueCallback(); module.remove.queueCallback();
} }
}, },

Loading…
Cancel
Save