NIHVIVO-2343 Use more specific CSS style names to avoid conflict.

This commit is contained in:
j2blake 2011-10-28 14:53:13 +00:00
parent 9fa5986cf2
commit f5fc34628b
2 changed files with 12 additions and 8 deletions

View file

@ -4,12 +4,12 @@
/* BOGUS STUFF FOR PROXIES ------------------------------------> */ /* BOGUS STUFF FOR PROXIES ------------------------------------> */
/* -------------------------------------------------> */ /* -------------------------------------------------> */
.new { .newProxyItem {
background-color: #DDFFDD; background-color: #DDFFDD;
} }
.existing { .existingProxyItem {
background-color: #DDDDDD; background-color: #DDDDDD;
} }
.removed { .removedProxyItem {
background-color: #FFDDDD; background-color: #FFDDDD;
} }

View file

@ -25,8 +25,12 @@
* %imageUrl% -- the URL that will fetch the image of the individual, * %imageUrl% -- the URL that will fetch the image of the individual,
* or a placeholder image. * or a placeholder image.
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* This relies on magic names for the styles:
* existingProxyItem -- for an item that was present when the page was loaded
* newProxyItem -- for an item that was added since the page was loaded
* removedProxyItem -- added to an item when the "remove" link is cheked.
* ----------------------------------------------------------------------------
*/ */
function proxyInfoElement(template, uri, label, classLabel, imageUrl, existing) { function proxyInfoElement(template, uri, label, classLabel, imageUrl, existing) {
this.uri = uri; this.uri = uri;
this.label = label; this.label = label;
@ -56,11 +60,11 @@ function proxyInfoElement(template, uri, label, classLabel, imageUrl, existing)
if (removed) { if (removed) {
removeLink.text(restoreText); removeLink.text(restoreText);
proxyUriField.attr('disabled', 'disabled'); proxyUriField.attr('disabled', 'disabled');
element.addClass('removed'); element.addClass('removedProxyItem');
} else { } else {
removeLink.text(removeText); removeLink.text(removeText);
proxyUriField.attr('disabled', ''); proxyUriField.attr('disabled', '');
element.removeClass('removed'); element.removeClass('removedProxyItem');
} }
} }
@ -70,8 +74,8 @@ function proxyInfoElement(template, uri, label, classLabel, imageUrl, existing)
return false; return false;
}); });
element.removeClass('new existing removed'); element.removeClass('newProxyItem existingProxyItem removedProxyItem');
element.addClass(existed ? 'existing' : 'new') element.addClass(existed ? 'existingProxyItem' : 'newProxyItem')
showRemoved() showRemoved()
return element; return element;