salix/client/core/src/drop-down/drop-down.js

28 lines
677 B
JavaScript
Raw Normal View History

import {module} from '../module';
import './style.scss';
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'];
module.component('vnDropDown', {
template: require('./drop-down.html'),
controller: DropDown,
bindings: {
items: '<',
show: '<',
selected: '=',
top: '<?'
},
controllerAs: 'dd'
});