Skip to content

Instantly share code, notes, and snippets.

@rassie
Created August 24, 2009 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rassie/174247 to your computer and use it in GitHub Desktop.
Save rassie/174247 to your computer and use it in GitHub Desktop.
$thisEditor.find("div:first > div:first > div:not(:first)") // Find all artist entry lines,
.filter(":has(input.artistCredit:visible)") // and for those lines with visible AC fields,
.find("input.artistName, div.artistResolvedName") // get the artist name input and resolved text elements in each,
.each(function () { // make sure the width of those fields is at the 'visible AC' width,
$(this).css("width", "19em");
}
)
.end() // then return to the pre-find,
.end() // pre-filter 'all artist entry lines' collection,
.filter(":has(input.artistCredit:hidden)") // get those without a visible AC field,
.find("input.artistName") // get the artist name input and resolved text elements in each,
.each(function () { // and stretch out the width for the ones without a visible AC field.
$(this).css("width", artistEditor.widthNameAndAC - parseFloat($(0.5).toPx(), 10) - 2 + "px");
}
)
.end()
.find("div.artistResolvedName").log()
.each(function () {
$(this).css("width", artistEditor.widthNameAndAC + 2 + "px");
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment