Skip to content

Commit

Permalink
EE3: Hide tabs when they have no visible fields
Browse files Browse the repository at this point in the history
Issue: rsanchez#48

Updating code to work with the new EE3 Publish layout
  • Loading branch information
noellekimiko committed Jun 16, 2017
1 parent f8930bf commit 228dadb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions javascript/EntryType.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var $holdFields = $("fieldset[id^=hold_field_]").filter(function(){
return this.id.match(/^hold_field_\d+$/);
}),
$tabs = $(".tab-wrap").find("li");
$tabs = $(".tab-wrap .tabs").find("li");

w.EntryType = {
fields: [],
Expand Down Expand Up @@ -40,10 +40,10 @@
}
}
$tabs.each(function() {
var id = this.id.replace(/^menu_/, ""),
var tabNum = $(this).find("a").attr("rel"),
$tab = $(this),
$fieldset = $("#"+id),
$visibleFields = $fieldset.find(".publish_field").filter(function() {
$tabContents = $("div.tab."+tabNum),
$visibleFields = $tabContents.find("fieldset").filter(function() {
return $(this).css("display") !== "none";
});

Expand Down

0 comments on commit 228dadb

Please sign in to comment.