Skip to content

Commit

Permalink
Add hint message
Browse files Browse the repository at this point in the history
Zefling committed Aug 3, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 52bed2e commit 3a9c9bc
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
@@ -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">
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
@@ -13,6 +13,9 @@ export * from './common';

let nextUniqueId = 0;

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

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

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

// material fix (firefox)

0 comments on commit 3a9c9bc

Please sign in to comment.