make the editable facet values behave like a toggled drawer (to save vertical space in the sidebar)

git-svn-id: http://google-refine.googlecode.com/svn/trunk@530 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-04-24 06:47:03 +00:00
parent 2bd88bd848
commit c9e4214a89
3 changed files with 14 additions and 3 deletions

View File

@ -108,6 +108,7 @@ ListFacet.prototype._initializeUI = function() {
this._div.empty().show().html(
'<div class="facet-title">' +
'<img src="images/close.png" title="Remove this facet" class="facet-choice-link" bind="removeButton"/>' +
'<a href="javascript:{}" class="facet-choice-link" bind="changeButton">change</a>' +
'<span bind="titleSpan"></span>' +
'</div>' +
'<div class="facet-expression" bind="expressionDiv"></div>' +
@ -135,7 +136,10 @@ ListFacet.prototype._initializeUI = function() {
this._elmts = DOM.bind(this._div);
this._elmts.titleSpan.text(this._config.name);
this._elmts.expressionDiv.text(this._config.expression).click(function() { self._editExpression(); });
this._elmts.changeButton.attr("title","Current Expression: " + this._config.expression).click(function() {
self._elmts.expressionDiv.slideToggle(100);
});
this._elmts.expressionDiv.text(this._config.expression).hide().click(function() { self._editExpression(); });
this._elmts.removeButton.click(function() { self._remove(); });
this._elmts.resetButton.click(function() { self._reset(); });

View File

@ -100,6 +100,7 @@ RangeFacet.prototype._initializeUI = function() {
'<div class="facet-title" bind="headerDiv">' +
'<img src="images/close.png" class="facet-choice-link" title="Remove this facet" bind="removeButton" />' +
'<a href="javascript:{}" class="facet-choice-link" bind="resetButton">reset</a>' +
'<a href="javascript:{}" class="facet-choice-link" bind="changeButton">change</a>' +
'<span bind="facetTitle"></span>' +
'</div>' +
'<div class="facet-expression" bind="expressionDiv"></div>' +
@ -115,7 +116,12 @@ RangeFacet.prototype._initializeUI = function() {
this._elmts = DOM.bind(this._div);
this._elmts.facetTitle.text(this._config.name);
this._elmts.expressionDiv.text(this._config.expression).click(function() { self._editExpression(); });
this._elmts.changeButton.attr("title","Current Expression: " + this._config.expression).click(function() {
self._elmts.expressionDiv.slideToggle(100);
});
this._elmts.expressionDiv.text(this._config.expression).click(function() {
self._editExpression();
}).hide();
this._elmts.resetButton.click(function() {
self.reset();

View File

@ -71,7 +71,8 @@ li.facet-container {
font-family: monospace;
font-size: 11px;
background: #eee;
cursor: pointer;
cursor: text;
border-bottom: 1px solid #ccc;
}
.facet-status {