Skip to content
Permalink
Browse files

Changed toString call so only invoked if data-for is set.

  • Loading branch information...
SirRawlins committed May 23, 2019
1 parent c6e7151 commit ba87e48dce355f141c9eb8b3ef3d7330a9c802f5
Showing with 7 additions and 7 deletions.
  1. +2 −2 dist/status-bar.js
  2. +2 −2 dist/status-bar.min.js
  3. +1 −1 dist/status-bar.min.js.map
  4. +2 −2 src/javascripts/status-bar.js
var script_tag = $($('script[src$="status-bar.min.js"]')[0]);
// Determine any pages assigned to the script tag.
// Default to no pages if we don't find any.
var pages = script_tag.data("for").toString();
var pages = script_tag.data("for");

// See if any 'for' pages defined.
if (typeof pages !== 'undefined') {
// Loop over all pages assigned on the including script tag.
// TODO: Can we abstract this out into a separate method?
$(pages.split(",")).each(function() {
$(pages.toString().split(",")).each(function() {
// Check to see if a status bar locator is present.
if($('[data-status-bar-for="' + this + '"]').length === 0) {
// We don't have a container / locator for our status bar

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -402,13 +402,13 @@
var script_tag = $($('script[src$="status-bar.min.js"]')[0]);
// Determine any pages assigned to the script tag.
// Default to no pages if we don't find any.
var pages = script_tag.data("for").toString();
var pages = script_tag.data("for");

// See if any 'for' pages defined.
if (typeof pages !== 'undefined') {
// Loop over all pages assigned on the including script tag.
// TODO: Can we abstract this out into a separate method?
$(pages.split(",")).each(function() {
$(pages.toString().split(",")).each(function() {
// Check to see if a status bar locator is present.
if($('[data-status-bar-for="' + this + '"]').length === 0) {
// We don't have a container / locator for our status bar

0 comments on commit ba87e48

Please sign in to comment.
You can’t perform that action at this time.