Skip to content

Commit a759929

Browse files
authored
Merge pull request #67 from ali1k/v1.3.7
fixed the issue with toggling action items in dropdown menu
2 parents 84d3f54 + 3f25f44 commit a759929

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

components/dataset/DatasetPager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ class DatasetPager extends React.Component {
168168
}
169169
//action menu
170170
let a_options = [
171-
{ key: 1, icon: 'search', text: 'Search in Results', value: 'searchInResults' },
172-
{ key: 2, icon: 'download', text: 'Download Results', value: 'downloadResults' }
171+
{ key: 1, icon: 'search', text: 'Search in Results', value: 'searchInResults' , onClick: this.handleActionDropDownClick.bind(this)},
172+
{ key: 2, icon: 'download', text: 'Download Results', value: 'downloadResults', onClick: this.handleActionDropDownClick.bind(this) }
173173
];
174174
if(this.props.enableQuerySaveImport){
175-
a_options.push({ key: 3, icon: 'save', text: 'Save Query', value: 'saveQuery' });
175+
a_options.push({ key: 3, icon: 'save', text: 'Save Query', value: 'saveQuery', onClick: this.handleActionDropDownClick.bind(this)});
176176
}
177177
let iconC = (this.state.config && this.state.config.datasetViewer) ? (v_icons[this.state.config.datasetViewer] ? v_icons[this.state.config.datasetViewer] : defaultViewIcon) : defaultViewIcon;
178178
const v_trigger = (
@@ -255,7 +255,7 @@ class DatasetPager extends React.Component {
255255
</div>
256256
<div className="right menu stackable">
257257
{this.props.total || (this.props.hasResources && !this.props.total) ?
258-
<Dropdown className="item" title="actions" selectOnBlur={false} onChange={this.handleActionDropDownClick.bind(this)} trigger={a_trigger} options={a_options} icon={null} pointing="top right" floating />
258+
<Dropdown className="item" title="actions" selectOnBlur={false} trigger={a_trigger} options={a_options} icon={null} pointing="top right" floating />
259259
: ''}
260260
<Dropdown className="item" title="views" selectOnBlur={false} onChange={this.handleViewsDropDownClick.bind(this)} trigger={v_trigger} options={v_options} icon={null} pointing="top right" floating />
261261
{this.props.onExpandCollapse ?

components/dataset/Facet.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,22 @@ class Facet extends React.Component {
346346
let rangeStat = !this.state.rangeEnabled ? 'Show' : 'Hide';
347347
let addedAsVarStat = !this.props.analysisProps[this.props.spec.propertyURI] ? 'Analyze property' : 'Remove from analysis';
348348
let d_options = [
349-
{ key: 5, text: addedAsVarStat , value: 'asVariable' },
350-
{ key: 6, text: shuffleStat + ' the list', value: 'shuffle' },
351-
{ key: 7, text: rangeStat + ' range options', value: 'range' },
352-
{ key: 8, text: 'Download the list', value: 'download' }
349+
{ key: 5, text: addedAsVarStat , value: 'asVariable', onClick: this.handleDropDownClick.bind(this)},
350+
{ key: 6, text: shuffleStat + ' the list', value: 'shuffle', onClick: this.handleDropDownClick.bind(this) },
351+
{ key: 7, text: rangeStat + ' range options', value: 'range', onClick: this.handleDropDownClick.bind(this) },
352+
{ key: 8, text: 'Download the list', value: 'download', onClick: this.handleDropDownClick.bind(this) }
353353
];
354354
let selectAllFlag = 0;
355355
if(this.props.selection && this.props.selection[this.props.spec.propertyURI] && this.props.selection[this.props.spec.propertyURI].length){
356-
d_options.unshift({ key: 4, text: 'Deselect All', value: 'deselectAll' });
356+
d_options.unshift({ key: 4, text: 'Deselect All', value: 'deselectAll', onClick: this.handleDropDownClick.bind(this) });
357357
selectAllFlag = 1;
358358
}
359359
//can select maximum 100 items
360360
if(!selectAllFlag && this.filteredInstances.length && this.filteredInstances.length <100){
361-
d_options.unshift({ key: 4, text: 'Select All', value: 'selectAll' });
361+
d_options.unshift({ key: 4, text: 'Select All', value: 'selectAll', onClick: this.handleDropDownClick.bind(this) });
362362
}
363363
if(this.props.selection && this.props.selection[this.props.spec.propertyURI] && this.props.selection[this.props.spec.propertyURI].length){
364-
d_options.unshift({ key: 3, text: invertStat + ' the selection', value: 'invert' });
364+
d_options.unshift({ key: 3, text: invertStat + ' the selection', value: 'invert', onClick: this.handleDropDownClick.bind(this) });
365365
}
366366
let b_options = [
367367
{ key: 1, icon: 'list layout', text: 'Check List', value: 'CheckListBrowser' },
@@ -529,7 +529,7 @@ class Facet extends React.Component {
529529
</div>
530530
<div className="right stackable menu">
531531
{this.props.spec.property ?
532-
<Dropdown className="item" title="actions" selectOnBlur={false} onChange={this.handleDropDownClick.bind(this)} trigger={d_trigger} options={d_options} icon={null} pointing="top left" floating />
532+
<Dropdown className="item" title="actions" selectOnBlur={false} trigger={d_trigger} options={d_options} icon={null} pointing="top left" floating />
533533
: ''
534534
}
535535
{this.props.spec.property ?

0 commit comments

Comments
 (0)