2017-06-13 11:08:06 +00:00
|
|
|
import {module} from '../module';
|
|
|
|
import './style.scss';
|
|
|
|
|
2017-06-15 05:45:01 +00:00
|
|
|
export default class DropDown {
|
|
|
|
constructor($element, $window) {
|
|
|
|
this.$element = $element;
|
|
|
|
this.$window = $window;
|
|
|
|
}
|
|
|
|
$onChanges(changesObj) {
|
|
|
|
if (changesObj.show && changesObj.top && changesObj.top.currentValue) {
|
|
|
|
this.$element.css('top', changesObj.top.currentValue + 'px');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DropDown.$inject = ['$element', '$window'];
|
2017-06-13 11:08:06 +00:00
|
|
|
|
|
|
|
module.component('vnDropDown', {
|
|
|
|
template: require('./drop-down.html'),
|
2017-06-15 05:45:01 +00:00
|
|
|
controller: DropDown,
|
2017-06-13 11:08:06 +00:00
|
|
|
bindings: {
|
|
|
|
items: '<',
|
|
|
|
show: '<',
|
2017-06-15 05:45:01 +00:00
|
|
|
selected: '=',
|
|
|
|
top: '<?'
|
2017-06-13 11:08:06 +00:00
|
|
|
},
|
|
|
|
controllerAs: 'dd'
|
|
|
|
});
|