Commit 28853c7df5c89b2db1d965a62ef2e957338672a1

Authored by Igor Kulikov
1 parent 98f52571

UI: MS Edge/IE compatibility.

1 1 {
2 2 "name": "thingsboard",
3 3 "private": true,
4   - "version": "1.3.0",
  4 + "version": "1.3.1",
5 5 "description": "Thingsboard UI",
6 6 "licenses": [
7 7 {
... ... @@ -50,6 +50,7 @@
50 50 "canvas-gauges": "^2.0.9",
51 51 "clipboard": "^1.5.15",
52 52 "compass-sass-mixins": "^0.12.7",
  53 + "event-source-polyfill": "0.0.9",
53 54 "flot": "git://github.com/flot/flot.git#0.9-work",
54 55 "flot-curvedlines": "git://github.com/MichaelZinsmaier/CurvedLines.git#master",
55 56 "font-awesome": "^4.6.3",
... ...
... ... @@ -15,6 +15,9 @@
15 15 */
16 16
17 17 import './ie.support';
  18 +
  19 +import 'event-source-polyfill';
  20 +
18 21 import angular from 'angular';
19 22 import ngMaterial from 'angular-material';
20 23 import ngMdIcons from 'angular-material-icons';
... ...
... ... @@ -839,7 +839,7 @@ export default function WidgetController($scope, $state, $timeout, $window, $ele
839 839 subscription.destroy();
840 840 }
841 841 subscriptionInited = false;
842   - widgetContext.subscriptions = [];
  842 + widgetContext.subscriptions = {};
843 843 if (widgetContext.inited) {
844 844 widgetContext.inited = false;
845 845 for (var cafId in cafs) {
... ...
... ... @@ -26,4 +26,32 @@
26 26 return this.indexOf(suffix, this.length - suffix.length) !== -1;
27 27 };
28 28 }
  29 + if (!String.prototype.repeat) {
  30 + String.prototype.repeat = function(count) {
  31 + if (this == null) {
  32 + throw TypeError();
  33 + }
  34 + var string = String(this);
  35 + // `ToInteger`
  36 + var n = count ? Number(count) : 0;
  37 + if (n != n) { // better `isNaN`
  38 + n = 0;
  39 + }
  40 + // Account for out-of-bounds indices
  41 + if (n < 0 || n == Infinity) {
  42 + throw RangeError();
  43 + }
  44 + var result = '';
  45 + while (n) {
  46 + if (n % 2 == 1) {
  47 + result += string;
  48 + }
  49 + if (n > 1) {
  50 + string += string;
  51 + }
  52 + n >>= 1;
  53 + }
  54 + return result;
  55 + };
  56 + }
29 57 })();
\ No newline at end of file
... ...
... ... @@ -157,7 +157,13 @@ export default class CanvasDigitalGauge extends canvasGauges.BaseGauge {
157 157
158 158 draw() {
159 159 try {
  160 +
160 161 let canvas = this.canvas;
  162 +
  163 + if (!canvas.drawWidth || !canvas.drawHeight) {
  164 + return this;
  165 + }
  166 +
161 167 let [x, y, w, h] = [
162 168 -canvas.drawX,
163 169 -canvas.drawY,
... ...
... ... @@ -181,7 +181,7 @@ function AlarmsTableWidgetController($element, $scope, $filter, $mdMedia, $mdDia
181 181 vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true;
182 182
183 183 var pageSize = vm.settings.defaultPageSize;
184   - if (angular.isDefined(pageSize) && Number.isInteger(pageSize) && pageSize > 0) {
  184 + if (angular.isDefined(pageSize) && angular.isNumber(pageSize) && pageSize > 0) {
185 185 vm.defaultPageSize = pageSize;
186 186 }
187 187
... ...
... ... @@ -167,7 +167,7 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $tra
167 167 vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true;
168 168
169 169 var pageSize = vm.settings.defaultPageSize;
170   - if (angular.isDefined(pageSize) && Number.isInteger(pageSize) && pageSize > 0) {
  170 + if (angular.isDefined(pageSize) && angular.isNumber(pageSize) && pageSize > 0) {
171 171 vm.defaultPageSize = pageSize;
172 172 }
173 173
... ...
... ... @@ -58,14 +58,17 @@ export default class TbImageMap {
58 58 }
59 59
60 60 var imageMap = this;
61   - var testImage = new Image(); // eslint-disable-line no-undef
  61 + var testImage = document.createElement('img'); // eslint-disable-line
  62 + testImage.style.visibility = 'hidden';
62 63 testImage.onload = function() {
63 64 imageMap.aspect = testImage.width / testImage.height;
  65 + document.body.removeChild(testImage); //eslint-disable-line
64 66 imageMap.onresize();
65 67 if (initCallback) {
66 68 setTimeout(initCallback, 0); //eslint-disable-line
67 69 }
68 70 }
  71 + document.body.appendChild(testImage); //eslint-disable-line
69 72 testImage.src = imageUrl;
70 73 }
71 74
... ...
... ... @@ -52,7 +52,7 @@
52 52 position: relative;
53 53 margin: auto;
54 54 background: transparent no-repeat scroll 0 0;
55   - background-size: cover;
  55 + background-size: 100% 100%;
56 56
57 57 &.is-pointer {
58 58 cursor: pointer !important;
... ...
... ... @@ -51,7 +51,7 @@ module.exports = {
51 51 new HtmlWebpackPlugin({
52 52 template: './src/index.html',
53 53 filename: 'index.html',
54   - title: 'Thingsboard',
  54 + title: 'ThingsBoard',
55 55 inject: 'body',
56 56 }),
57 57 new webpack.optimize.OccurrenceOrderPlugin(),
... ...
... ... @@ -47,7 +47,7 @@ module.exports = {
47 47 new HtmlWebpackPlugin({
48 48 template: './src/index.html',
49 49 filename: '../index.html',
50   - title: 'Thingsboard',
  50 + title: 'ThingsBoard',
51 51 inject: 'body',
52 52 }),
53 53 new webpack.optimize.OccurrenceOrderPlugin(),
... ...