{:uriI"file:///Users/tvd/.gem/ruby/2.7.4/bundler/gems/solidus-2596bdd61623/backend/app/assets/javascripts/spree/backend/components/tabs.js?type=application/javascript&pipeline=self&id=bd24631f5dea46c547c0d03b65becb3452577c46c14ef205042a47ee125e3001:ET:load_pathI"`/Users/tvd/.gem/ruby/2.7.4/bundler/gems/solidus-2596bdd61623/backend/app/assets/javascripts;T: filenameI"|/Users/tvd/.gem/ruby/2.7.4/bundler/gems/solidus-2596bdd61623/backend/app/assets/javascripts/spree/backend/components/tabs.js;T: nameI""spree/backend/components/tabs;T:logical_pathI"*spree/backend/components/tabs.self.js;T:content_typeI"application/javascript;T: sourceI"/* global Tabs */ Tabs = (function() { function Tabs(el) { _.bindAll(this, 'overflowTabs'); this.el = el; this.tabs = this.el.querySelectorAll("li:not(.tabs-dropdown)") /*
  • */ this.dropdown = document.createElement('li'); this.dropdown.classList.add('tabs-dropdown'); this.dropdown.appendChild(document.createElement('a')); this.dropdownList = document.createElement('ul'); this.dropdown.appendChild(this.dropdownList); this.el.appendChild(this.dropdown); this.tabWidths = _.map(this.tabs, function(tab) { return tab.offsetWidth; }); this.totalTabsWidth = this.tabWidths.reduce(function(previousValue, currentValue) { return previousValue + currentValue; }); window.addEventListener("resize", this.overflowTabs); this.overflowTabs(); } Tabs.prototype.overflowTabs = function() { var containerWidth = this.el.offsetWidth; var dropdownWidth = this.dropdown.offsetWidth; for (var i = 0; i < this.tabs.length; i++) { var tab = this.tabs[i]; tab.parentNode.removeChild(tab); } if (this.totalTabsWidth < containerWidth) { this.el.classList.remove("tabs-overflowed"); } else { this.el.classList.add("tabs-overflowed"); remainingWidth -= dropdownWidth; } var remainingWidth = containerWidth; for (var i = 0; i < this.tabs.length; i++) { remainingWidth -= this.tabWidths[i]; var tab = this.tabs[i]; if (remainingWidth >= 0) { tab.classList.remove("in-dropdown"); this.el.insertBefore(tab, this.dropdown); } else { tab.classList.add("in-dropdown"); this.dropdownList.appendChild(tab); } } }; return Tabs; })(); window.addEventListener('load', function() { _.each(document.querySelectorAll('.tabs'), function(el) { new Tabs(el); }); }); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"file-digest:///Users/tvd/.gem/ruby/2.7.4/bundler/gems/solidus-2596bdd61623/backend/app/assets/javascripts/spree/backend/components/tabs.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: to_loado;;}F: to_linko;;}F:map{ I" version;TiI" file;TI"%spree/backend/components/tabs.js;TI" mappings;TI"NAAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;TI" sources;T[I"tabs.source.js;TI" names;T[I"x_sprockets_linecount;TiH: charsetI" utf-8;F: digest"%m8(aEtC9Z_n: lengthi:environment_versionI"1.0;T:dependencies_digest"%O=q?۟:DV]Gn J:idI"Ebd24631f5dea46c547c0d03b65becb3452577c46c14ef205042a47ee125e3001;F