Sha256: afb412a16daadde561e105d6ed440338950768b566abcec7b191e72a751e9e56

Contents?: true

Size: 382 Bytes

Versions: 8

Compression:

Stored size: 382 Bytes

Contents

// Add error indicators to tabs
Trestle.init(function(e, root) {
  $(root).find('.tab-pane').each(function() {
    var errorCount = $(this).find('.has-error').length;

    if (errorCount > 0) {
      var indicator = $("<span>").addClass('label label-danger label-pill').text(errorCount);
      $(".nav-tabs a[href='#" + $(this).attr('id') + "']").append(indicator);
    }
  });
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trestle-0.8.13 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.12 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.11 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.10 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.9 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.8 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.7 app/assets/javascripts/trestle/components/_errors.js
trestle-0.8.6 app/assets/javascripts/trestle/components/_errors.js