Skip to content

Commit

Permalink
fix(chore): unify invoke method, removed unused error strings
Browse files Browse the repository at this point in the history
Some modules missed the error message when a given behavior does not exist, although the error string was already present in the code.
On the other hand there were some unused error strings, which i removed.
  • Loading branch information
lubber-de authored Jan 16, 2023
1 parent 9a0ff54 commit dc9662f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down
1 change: 0 additions & 1 deletion src/definitions/behaviors/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@

// error
error: {
beforeSend: 'The before send function has cancelled state change',
method: 'The method you called is not defined.',
},

Expand Down
2 changes: 2 additions & 0 deletions src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down
4 changes: 3 additions & 1 deletion src/definitions/modules/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

namespace = settings.namespace,
className = settings.className,
error = settings.error,
metadata = settings.metadata,
selector = settings.selector,
cssVars = settings.cssVars,
Expand Down Expand Up @@ -431,6 +432,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down Expand Up @@ -492,7 +495,6 @@

error: {
method: 'The method you called is not defined',
noMaximum: 'No maximum rating specified. Cannot generate HTML automatically',
},

metadata: {
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down Expand Up @@ -1368,8 +1370,6 @@
source: 'Cannot search. No source used, and Fomantic API module was not included',
noResultsHeader: 'No Results',
noResults: 'Your search returned no results',
logging: 'Error in debug logging, exiting.',
noEndpoint: 'No search endpoint was specified',
noTemplate: 'A valid template name was not specified.',
oldSearchSyntax: 'searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.',
serverError: 'There was an issue querying the server.',
Expand Down
2 changes: 2 additions & 0 deletions src/definitions/modules/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down
5 changes: 2 additions & 3 deletions src/definitions/modules/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@
tagName = $container[0].tagName
;
if (tagName === 'HTML' || tagName === 'body') {
// this can trigger for too many reasons
// module.error(error.container, tagName, $module);
module.determineContainer();
} else {
var tallestHeight = Math.max(module.cache.context.height, module.cache.element.height);
Expand Down Expand Up @@ -804,6 +802,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down Expand Up @@ -896,7 +896,6 @@
onBottom: function () {},

error: {
container: 'Sticky element must be inside a relative container',
visible: 'Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.',
method: 'The method you called is not defined.',
invalidContext: 'Context specified does not exist',
Expand Down
3 changes: 2 additions & 1 deletion src/definitions/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@

return false;
} else {
module.error(error.method, query);

return false;
}
});
Expand Down Expand Up @@ -1075,7 +1077,6 @@
// possible errors
error: {
noAnimation: 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
repeated: 'That animation is already occurring, cancelling repeated animation',
method: 'The method you called is not defined',
support: 'This browser does not support CSS animations',
},
Expand Down

0 comments on commit dc9662f

Please sign in to comment.