Show/hide "cluster" button in list facet appropriately after the facet's expression is edited.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@533 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-04-24 07:29:01 +00:00
parent 2a5d99fe16
commit d14b840d04

View File

@ -155,9 +155,8 @@ ListFacet.prototype._initializeUI = function() {
this._elmts.sortGroup.buttonset(); this._elmts.sortGroup.buttonset();
if (this._config.expression == "value") {
this._elmts.clusterLink.click(function() { self._doEdit(); }).button(); this._elmts.clusterLink.click(function() { self._doEdit(); }).button();
} else { if (this._config.expression != "value" && this._config.expression != "gel:value") {
this._elmts.clusterLink.hide(); this._elmts.clusterLink.hide();
} }
@ -511,7 +510,14 @@ ListFacet.prototype._editExpression = function() {
function(expr) { function(expr) {
if (expr != self._config.expression) { if (expr != self._config.expression) {
self._config.expression = expr; self._config.expression = expr;
self._elmts.expressionDiv.text(self._config.expression); self._elmts.expressionDiv.text(self._config.expression);
if (self._config.expression == "value" || self._config.expression == "gel:value") {
self._elmts.clusterLink.show();
} else {
self._elmts.clusterLink.hide();
}
self.reset(); self.reset();
self._updateRest(); self._updateRest();
} }