thingsboard-aplcache
Changes
ui/src/app/ie.support.js 18(+18 -0)
Details
diff --git a/ui/src/app/components/widget/widget-config.directive.js b/ui/src/app/components/widget/widget-config.directive.js
index 8ec91a8..4e19bfd 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 0000000..4982b6c
--- /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 d5337ef..ce179c3 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.
-->
-<md-tabs ng-class="{'tb-headless': (widgetType === types.widgetType.static.value && !displayAdvanced())}" id="tabs" md-border-bottom flex class="tb-absolute-fill"
+<md-tabs ng-class="{'tb-headless': (widgetType === types.widgetType.static.value && !displayAdvanced())}"
+ id="tabs" md-border-bottom flex class="tb-widget-config tb-absolute-fill"
md-selected="selectedTab">
<md-tab label="{{ 'widget-config.data' | translate }}"
ng-show="widgetType !== types.widgetType.static.value">
@@ -273,7 +274,7 @@
</div>
</md-tab>
<md-tab ng-if="displayAdvanced()" label="{{ 'widget-config.advanced' | translate }}">
- <md-content class="md-padding" layout="column">
+ <md-content flex class="md-padding tb-advanced-widget-config" layout="column">
<ng-form flex name="ngform"
layout="column"
layout-padding>
ui/src/app/ie.support.js 18(+18 -0)
diff --git a/ui/src/app/ie.support.js b/ui/src/app/ie.support.js
index e0dce28..da5c1a0 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