Skip to content

Commit

Permalink
Add hint message
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefling committed Aug 2, 2017
1 parent 61a5eae commit 00278e1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
17 changes: 13 additions & 4 deletions src/angular.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { Select2 } from './angular';
import { Select2, Select2Hint } from './angular';

@NgModule({
imports: [CommonModule],
exports: [Select2],
declarations: [Select2],
declarations: [
Select2Hint,
Select2
],
imports: [
CommonModule
],
exports: [
Select2Hint,
Select2
]
})
export class Select2Module { }

export * from './angular';
export * from './common';
3 changes: 3 additions & 0 deletions src/angular.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
</li>
</ul>
</div>
<div class="select2-subscript-wrapper">
<ng-content select="select2-hint"></ng-content>
</div>
</div>
<div [class]="dropdownStyle">
<div class="select2-dropdown select2-dropdown--below">
Expand Down
7 changes: 5 additions & 2 deletions src/angular.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Component, Input, Output, EventEmitter, ElementRef, ViewChild, Optional, Self, ChangeDetectorRef, ViewEncapsulation,
Attribute
Component, Directive, Input, Output, EventEmitter, ElementRef, ViewChild, Optional, Self, ChangeDetectorRef,
ViewEncapsulation, Attribute
} from '@angular/core';
import {
FormGroupDirective, NgControl, NgForm, ControlValueAccessor
Expand All @@ -13,6 +13,9 @@ export * from './common';

let nextUniqueId = 0;

@Directive({ selector: 'select2-hint' })
export class Select2Hint { }

@Component({
selector: 'select2',
styleUrls: ['./select2.css'],
Expand Down
6 changes: 6 additions & 0 deletions src/select2.less
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ select2.material {
border: 0;
}
}

.select2-subscript-wrapper {
position: absolute;
top: calc(100% - 1.72917em);
font-size: 75%;
}
}

// material fix (firefox)
Expand Down

0 comments on commit 00278e1

Please sign in to comment.