Skip to content

Commit

Permalink
add additional checks to ensure that elements exist before any jQuery…
Browse files Browse the repository at this point in the history
… logic
  • Loading branch information
jakemmarsh committed Mar 8, 2015
1 parent 567041d commit bf2ad4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/js/Mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ module.exports = function(settings, done) {
renderCurrentStep: function() {
var element = null;
var currentStep = this.settings.steps[this.state.currentIndex];
var $target = $(currentStep.element);
var cssPosition = $target.css('position');
var $target = currentStep && currentStep.element ? $(currentStep.element) : null;
var cssPosition = $target ? $target.css('position') : null;

if ( $target && $target.length ) {
if ( this.state.showTooltip ) {
Expand Down
4 changes: 2 additions & 2 deletions lib/js/Mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ module.exports = function(settings, done) {
renderCurrentStep: function() {
var element = null;
var currentStep = this.settings.steps[this.state.currentIndex];
var $target = $(currentStep.element);
var cssPosition = $target.css('position');
var $target = currentStep && currentStep.element ? $(currentStep.element) : null;
var cssPosition = $target ? $target.css('position') : null;

if ( $target && $target.length ) {
if ( this.state.showTooltip ) {
Expand Down

0 comments on commit bf2ad4b

Please sign in to comment.