From 5f2aa345ba9bfa7970d83198074497e0b9bb26fb Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 15 Jun 2017 11:22:47 +0200 Subject: [PATCH] iconMenu arreglo de posicion del DropDown interno --- client/core/src/autocomplete/autocomplete.js | 9 ++- client/core/src/components.js | 2 +- client/core/src/icon-button/icon-button.html | 4 +- client/core/src/icon-button/icon-button.js | 21 +------ .../core/src/icon-button/icon-button.mdl.html | 3 - .../core/src/icon-button/icon-button.mdl.js | 15 ----- client/core/src/icon-menu/icon-menu.js | 11 +--- client/core/src/icon-menu/style.scss | 3 + client/core/src/icon/icon.js | 19 +------ client/core/src/icon/icon.mdl.html | 1 - client/core/src/icon/icon.mdl.js | 12 ---- .../src/filter-panel/filter-panel.html | 54 ++++++++---------- client/production/src/index/index.html | 57 +++++++++++++------ client/production/src/index/index.js | 1 + client/production/src/index/style.scss | 14 +++++ 15 files changed, 95 insertions(+), 131 deletions(-) delete mode 100644 client/core/src/icon-button/icon-button.mdl.html delete mode 100644 client/core/src/icon-button/icon-button.mdl.js create mode 100644 client/core/src/icon-menu/style.scss delete mode 100644 client/core/src/icon/icon.mdl.html delete mode 100644 client/core/src/icon/icon.mdl.js diff --git a/client/core/src/autocomplete/autocomplete.js b/client/core/src/autocomplete/autocomplete.js index c46fcebf7..81e320676 100644 --- a/client/core/src/autocomplete/autocomplete.js +++ b/client/core/src/autocomplete/autocomplete.js @@ -10,7 +10,7 @@ export default class Autocomplete extends Component { super($element); this.input = $element[0].querySelector('input'); this.item = null; - this.data = null; + // this.data = null; this.popover = null; this.displayData = null; this.timeoutId = null; @@ -83,8 +83,10 @@ export default class Autocomplete extends Component { if (requestWillSame) this.localFilter(textFilter); - else + else if (this.url) this.requestData(textFilter, false); + else + this.setDisplayData(this.data); } getRequestFields() { let fields = {}; @@ -402,11 +404,12 @@ Autocomplete.$inject = ['$element', '$scope', '$http', 'vnPopover', '$transclude module.component('vnAutocomplete', { template: require('./autocomplete.html'), bindings: { - url: '@', + url: '@?', showField: '@?', valueField: '@?', selectFields: '@?', initialData: ' - {{ib.label}} + \ No newline at end of file diff --git a/client/core/src/icon-button/icon-button.js b/client/core/src/icon-button/icon-button.js index 806b86d83..55d4b1070 100644 --- a/client/core/src/icon-button/icon-button.js +++ b/client/core/src/icon-button/icon-button.js @@ -1,29 +1,12 @@ import {module as _module} from '../module'; -// import * as resolveFactory from '../lib/resolveDefaultComponents'; -import * as util from '../lib/util'; -const _NAME = 'iconButton'; -export const NAME = util.getName(_NAME); -/* -directive.$inject = [resolveFactory.NAME]; -export function directive(resolve) { - return { - restrict: 'E', - template: function(_, attr) { - return resolve.getTemplate(_NAME, attr); - } - }; -} -_module.directive(NAME, directive); */ - -_module.component(NAME, { +_module.component('vnIconButton', { template: require('./icon-button.html'), bindings: { icon: '@', className: ' - *[label]* - \ No newline at end of file diff --git a/client/core/src/icon-button/icon-button.mdl.js b/client/core/src/icon-button/icon-button.mdl.js deleted file mode 100644 index 14c9fa2a3..000000000 --- a/client/core/src/icon-button/icon-button.mdl.js +++ /dev/null @@ -1,15 +0,0 @@ -import {module} from '../module'; -import template from './icon-button.mdl.html'; - -export const NAME = 'vnIconButtonMdlFactory'; -export function factory() { - return { - template: template, - default: { - enabled: 'enabled', - icon: '', - label: '' - } - }; -} -module.factory(NAME, factory); diff --git a/client/core/src/icon-menu/icon-menu.js b/client/core/src/icon-menu/icon-menu.js index 9e5e52794..23d84b041 100644 --- a/client/core/src/icon-menu/icon-menu.js +++ b/client/core/src/icon-menu/icon-menu.js @@ -1,4 +1,5 @@ import {module} from '../module'; +import './style.scss'; export default class IconMenu { constructor($element, $http, $timeout) { @@ -6,7 +7,6 @@ export default class IconMenu { this.$http = $http; this.$timeout = $timeout; this._showDropDown = false; - this._pos = undefined; } get showDropDown() { return this._showDropDown; @@ -15,13 +15,6 @@ export default class IconMenu { this._showDropDown = value; } - get pos() { - return this._pos; - } - set pos(value) { - this._pos = value; - } - getItems() { this.$http.get(this.url).then( json => { @@ -37,8 +30,6 @@ export default class IconMenu { this.$element.bind('mouseover', e => { this.$timeout(() => { this.showDropDown = true; - if (e.target.nodeName === 'BUTTON') - this.pos = e.target.getBoundingClientRect(); }); }); diff --git a/client/core/src/icon-menu/style.scss b/client/core/src/icon-menu/style.scss new file mode 100644 index 000000000..e4e6b4104 --- /dev/null +++ b/client/core/src/icon-menu/style.scss @@ -0,0 +1,3 @@ +vn-icon-menu{ + position: relative; +} \ No newline at end of file diff --git a/client/core/src/icon/icon.js b/client/core/src/icon/icon.js index 29f3d0747..c979f86f9 100644 --- a/client/core/src/icon/icon.js +++ b/client/core/src/icon/icon.js @@ -1,24 +1,7 @@ import {module} from '../module'; -import './icon.mdl'; import './style.css'; -// import * as resolveFactory from '../lib/resolveDefaultComponents'; -// const _NAME = 'icon'; -export const NAME = 'vnIcon'; - -/* export function directive(resolver) { - return { - restrict: 'E', - template: function(_, attrs) { - return resolver.getTemplate(_NAME, attrs); - } - }; -} -directive.$inject = [resolveFactory.NAME]; - -module.directive(NAME, directive);*/ - -module.component(NAME, { +module.component('vnIcon', { template: '{{i.icon}}', bindings: { icon: '@' diff --git a/client/core/src/icon/icon.mdl.html b/client/core/src/icon/icon.mdl.html deleted file mode 100644 index 865296d9b..000000000 --- a/client/core/src/icon/icon.mdl.html +++ /dev/null @@ -1 +0,0 @@ -*[icon]* diff --git a/client/core/src/icon/icon.mdl.js b/client/core/src/icon/icon.mdl.js deleted file mode 100644 index 6a558285c..000000000 --- a/client/core/src/icon/icon.mdl.js +++ /dev/null @@ -1,12 +0,0 @@ -import {module} from '../module'; -import template from './icon.mdl.html'; - -export const NAME = 'vnIconMdlFactory'; -export function factory() { - return { - template: template, - default: {} - }; -} - -module.factory(NAME, factory); diff --git a/client/production/src/filter-panel/filter-panel.html b/client/production/src/filter-panel/filter-panel.html index 8ee87823c..5ef3ecdda 100644 --- a/client/production/src/filter-panel/filter-panel.html +++ b/client/production/src/filter-panel/filter-panel.html @@ -1,31 +1,23 @@ -
-
- - - - - - - - - - - - - - - - - - - - - -
-
\ No newline at end of file + +
+ + + + + + + + + + + + + + +
diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index f9188889c..8eed566b2 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,29 +1,54 @@ + + - + Localizador - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index c2d811af3..105f0d757 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -8,6 +8,7 @@ export default class ProductionIndex { this.filter = {}; this._checkAll = false; this.tickets = []; + this.states = []; this.lines = 0; this.meters = 0; this.actions = { diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index 63d0cd9a7..292a6fbb7 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -17,4 +17,18 @@ vn-production-index { .icon-square{ height: 36px; } + .locator-header{ + i{ + cursor: pointer; + } + .moreFilters{ + position: absolute; + z-index: 99; + background-color: white; + padding: 15px; + border: 1px solid #9D9D9D; + margin-top: 60px; + width: 600px; + } + } } \ No newline at end of file