Skip to content

Commit

Permalink
Fixed #963
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Sep 27, 2016
1 parent 71fc12d commit 98437d6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
51 changes: 27 additions & 24 deletions components/datatable/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,34 +576,37 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni
if(!column.sortable) {
return;
}

this.sortOrder = (this.sortField === column.field) ? this.sortOrder * -1 : 1;
this.sortField = column.field;
this.sortColumn = column;
let metaKey = event.metaKey||event.ctrlKey;

if(this.lazy) {
this.onLazyLoad.emit(this.createLazyLoadMetadata());
}
else {
if(this.sortMode == 'multiple') {
if(!this.multiSortMeta||!metaKey) {
this.multiSortMeta = [];
}

this.addSortMeta({field: this.sortField, order: this.sortOrder});
this.sortMultiple();

let targetNode = event.target.nodeName;
if(targetNode == 'TH' || (targetNode == 'SPAN' && !this.domHandler.hasClass(event.target, 'ui-c'))) {
this.sortOrder = (this.sortField === column.field) ? this.sortOrder * -1 : 1;
this.sortField = column.field;
this.sortColumn = column;
let metaKey = event.metaKey||event.ctrlKey;

if(this.lazy) {
this.onLazyLoad.emit(this.createLazyLoadMetadata());
}
else {
this.sortSingle();
if(this.sortMode == 'multiple') {
if(!this.multiSortMeta||!metaKey) {
this.multiSortMeta = [];
}

this.addSortMeta({field: this.sortField, order: this.sortOrder});
this.sortMultiple();
}
else {
this.sortSingle();
}
}

this.onSort.emit({
field: this.sortField,
order: this.sortOrder,
multisortmeta: this.multiSortMeta
});
}

this.onSort.emit({
field: this.sortField,
order: this.sortOrder,
multisortmeta: this.multiSortMeta
});
}

sortSingle() {
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const DROPDOWN_VALUE_ACCESSOR: any = {
<input type="text" class="ui-dropdown-label ui-inputtext ui-corner-all" *ngIf="editable"
(click)="onInputClick($event)" (input)="onInputChange($event)" (focus)="hide()">
<div class="ui-dropdown-trigger ui-state-default ui-corner-right" [ngClass]="{'ui-state-hover':hover&&!disabled,'ui-state-focus':focus}">
<span class="fa fa-fw fa-caret-down"></span>
<span class="fa fa-fw fa-caret-down ui-c"></span>
</div>
<div class="ui-dropdown-panel ui-widget-content ui-corner-all ui-helper-hidden ui-shadow"
[style.display]="panelVisible ? 'block' : 'none'">
Expand Down
2 changes: 1 addition & 1 deletion components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const MULTISELECT_VALUE_ACCESSOR: any = {
<label [ngClass]="{'ui-multiselect-label ui-corner-all':true,'ui-state-hover':hover,'ui-state-focus':focus}">{{valuesAsString}}</label>
</div>
<div [ngClass]="{'ui-multiselect-trigger ui-state-default ui-corner-right':true,'ui-state-hover':hover,'ui-state-focus':focus}">
<span class="fa fa-fw fa-caret-down"></span>
<span class="fa fa-fw fa-caret-down ui-c"></span>
</div>
<div class="ui-multiselect-panel ui-widget ui-widget-content ui-corner-all ui-shadow" [style.display]="overlayVisible ? 'block' : 'none'" (click)="panelClick=true">
<div class="ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix">
Expand Down

0 comments on commit 98437d6

Please sign in to comment.