diff options
author | Yaron Yogev <yaronyogev@gmail.com> | 2017-10-03 10:14:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-10-03 10:14:14 +0000 |
commit | 9e9c95952ca2a7efeafd316fff107b95fdd0f0b5 (patch) | |
tree | 6ad620ebc1f9adf6bf9fc671d88ea0adf8e7fe07 /ui/imports/ui/components/select-model | |
parent | 929a33a1cf8854e06d13e5ef352a48759c9ba2d5 (diff) | |
parent | 1fff14f0a5e25adaa851537c71c7bd8381c1bbb1 (diff) |
Merge "ui move to docker" into stable/euphrates
Diffstat (limited to 'ui/imports/ui/components/select-model')
-rw-r--r-- | ui/imports/ui/components/select-model/select-model.html | 23 | ||||
-rw-r--r-- | ui/imports/ui/components/select-model/select-model.js | 79 |
2 files changed, 0 insertions, 102 deletions
diff --git a/ui/imports/ui/components/select-model/select-model.html b/ui/imports/ui/components/select-model/select-model.html deleted file mode 100644 index 71b9c81..0000000 --- a/ui/imports/ui/components/select-model/select-model.html +++ /dev/null @@ -1,23 +0,0 @@ -<!-- -######################################################################################## -# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Apache License, Version 2.0 # -# which accompanies this distribution, and is available at # -# http://www.apache.org/licenses/LICENSE-2.0 # -######################################################################################## - --> -<template name="SelectModel"> - <select class="js-select form-control" - multiple="{{ multi }}" - {{ markIfDisabled }} - > - {{#if showNullOption }}<option value="">{{ nullOptionLabel }}</option>{{/if}} - {{#each option in options }} - <option value="{{ option.value }}" - selected="{{ isSelected option.value }}" - >{{ option.label }}</option> - {{/each }} - </select> -</template> diff --git a/ui/imports/ui/components/select-model/select-model.js b/ui/imports/ui/components/select-model/select-model.js deleted file mode 100644 index 01fca9c..0000000 --- a/ui/imports/ui/components/select-model/select-model.js +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others / -// / -// All rights reserved. This program and the accompanying materials / -// are made available under the terms of the Apache License, Version 2.0 / -// which accompanies this distribution, and is available at / -// http://www.apache.org/licenses/LICENSE-2.0 / -///////////////////////////////////////////////////////////////////////////////////////// -/* - * Template Component: SelectModel - */ - -//import { Meteor } from 'meteor/meteor'; -import { Template } from 'meteor/templating'; -import * as R from 'ramda'; -//import { ReactiveDict } from 'meteor/reactive-dict'; - -import './select-model.html'; - -/* - * Lifecycles - */ - -Template.SelectModel.onCreated(function() { -}); - -/* -Template.SelectModel.rendered = function() { -}; -*/ - -/* - * Events - */ - -Template.SelectModel.events({ - 'change .js-select': function (event) { - event.stopPropagation(); - event.preventDefault(); - - let instance = Template.instance(); - // Extract string values from select element's attribute. - let elementSelectedValues = R.map(function (optionEl) { - return optionEl.value; - }, event.target.selectedOptions); - - let selectedValues = instance.data.multi ? elementSelectedValues : - elementSelectedValues[0]; - - if (instance.data.setModel) { - instance.data.setModel(selectedValues); - } - } -}); - -/* - * Helpers - */ - -Template.SelectModel.helpers({ - isSelected: function (optionValue) { - let instance = Template.instance(); - let selectedValues = instance.data.values; - - if (R.isNil(selectedValues)) { return false; } - return R.contains(optionValue, selectedValues); - }, - markIfDisabled: function () { - let instance = Template.instance(); - let attrs = {}; - if (instance.data.disabled) { - attrs = R.assoc('disabled', true, attrs); - } - - return attrs; - } -}); - - |