diff --git a/ui/src/app/components/widget/widget-config.directive.js b/ui/src/app/components/widget/widget-config.directive.js index 8ec91a80c8..4e19bfdb34 100644 --- a/ui/src/app/components/widget/widget-config.directive.js +++ b/ui/src/app/components/widget/widget-config.directive.js @@ -24,6 +24,8 @@ import thingsboardJsonForm from '../json-form.directive'; import thingsboardManageWidgetActions from './action/manage-widget-actions.directive'; import 'angular-ui-ace'; +import './widget-config.scss'; + /* eslint-disable import/no-unresolved, import/default */ import widgetConfigTemplate from './widget-config.tpl.html'; @@ -136,7 +138,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout scope.datasources = []; } if (config.datasources) { - for (var i in config.datasources) { + for (var i = 0; i < config.datasources.length; i++) { scope.datasources.push({value: config.datasources[i]}); } } @@ -308,7 +310,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout config.datasources = []; } if (scope.datasources) { - for (var i in scope.datasources) { + for (var i = 0; i < scope.datasources.length; i++) { config.datasources.push(scope.datasources[i].value); } } diff --git a/ui/src/app/components/widget/widget-config.scss b/ui/src/app/components/widget/widget-config.scss new file mode 100644 index 0000000000..4982b6c7cd --- /dev/null +++ b/ui/src/app/components/widget/widget-config.scss @@ -0,0 +1,23 @@ +/** + * Copyright © 2016-2017 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.tb-widget-config { + md-tab-content.md-active > div { + height: 100%; + } + .tb-advanced-widget-config { + height: 100%; + } +} \ No newline at end of file diff --git a/ui/src/app/components/widget/widget-config.tpl.html b/ui/src/app/components/widget/widget-config.tpl.html index d5337ef850..ce179c388a 100644 --- a/ui/src/app/components/widget/widget-config.tpl.html +++ b/ui/src/app/components/widget/widget-config.tpl.html @@ -15,7 +15,8 @@ limitations under the License. --> - @@ -273,7 +274,7 @@ - + diff --git a/ui/src/app/ie.support.js b/ui/src/app/ie.support.js index e0dce28077..da5c1a09e0 100644 --- a/ui/src/app/ie.support.js +++ b/ui/src/app/ie.support.js @@ -54,4 +54,22 @@ return result; }; } + + (function (arr) { + arr.forEach(function (item) { + if (item.hasOwnProperty('remove')) { + return; + } + Object.defineProperty(item, 'remove', { + configurable: true, + enumerable: true, + writable: true, + value: function remove() { + if (this.parentNode !== null) + this.parentNode.removeChild(this); + } + }); + }); + })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); //eslint-disable-line + })(); \ No newline at end of file