Showing
11 changed files
with
49 additions
and
8 deletions
1 | { | 1 | { |
2 | "name": "thingsboard", | 2 | "name": "thingsboard", |
3 | "private": true, | 3 | "private": true, |
4 | - "version": "1.3.0", | 4 | + "version": "1.3.1", |
5 | "description": "Thingsboard UI", | 5 | "description": "Thingsboard UI", |
6 | "licenses": [ | 6 | "licenses": [ |
7 | { | 7 | { |
@@ -50,6 +50,7 @@ | @@ -50,6 +50,7 @@ | ||
50 | "canvas-gauges": "^2.0.9", | 50 | "canvas-gauges": "^2.0.9", |
51 | "clipboard": "^1.5.15", | 51 | "clipboard": "^1.5.15", |
52 | "compass-sass-mixins": "^0.12.7", | 52 | "compass-sass-mixins": "^0.12.7", |
53 | + "event-source-polyfill": "0.0.9", | ||
53 | "flot": "git://github.com/flot/flot.git#0.9-work", | 54 | "flot": "git://github.com/flot/flot.git#0.9-work", |
54 | "flot-curvedlines": "git://github.com/MichaelZinsmaier/CurvedLines.git#master", | 55 | "flot-curvedlines": "git://github.com/MichaelZinsmaier/CurvedLines.git#master", |
55 | "font-awesome": "^4.6.3", | 56 | "font-awesome": "^4.6.3", |
@@ -15,6 +15,9 @@ | @@ -15,6 +15,9 @@ | ||
15 | */ | 15 | */ |
16 | 16 | ||
17 | import './ie.support'; | 17 | import './ie.support'; |
18 | + | ||
19 | +import 'event-source-polyfill'; | ||
20 | + | ||
18 | import angular from 'angular'; | 21 | import angular from 'angular'; |
19 | import ngMaterial from 'angular-material'; | 22 | import ngMaterial from 'angular-material'; |
20 | import ngMdIcons from 'angular-material-icons'; | 23 | import ngMdIcons from 'angular-material-icons'; |
@@ -839,7 +839,7 @@ export default function WidgetController($scope, $state, $timeout, $window, $ele | @@ -839,7 +839,7 @@ export default function WidgetController($scope, $state, $timeout, $window, $ele | ||
839 | subscription.destroy(); | 839 | subscription.destroy(); |
840 | } | 840 | } |
841 | subscriptionInited = false; | 841 | subscriptionInited = false; |
842 | - widgetContext.subscriptions = []; | 842 | + widgetContext.subscriptions = {}; |
843 | if (widgetContext.inited) { | 843 | if (widgetContext.inited) { |
844 | widgetContext.inited = false; | 844 | widgetContext.inited = false; |
845 | for (var cafId in cafs) { | 845 | for (var cafId in cafs) { |
@@ -26,4 +26,32 @@ | @@ -26,4 +26,32 @@ | ||
26 | return this.indexOf(suffix, this.length - suffix.length) !== -1; | 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 | })(); |
@@ -157,7 +157,13 @@ export default class CanvasDigitalGauge extends canvasGauges.BaseGauge { | @@ -157,7 +157,13 @@ export default class CanvasDigitalGauge extends canvasGauges.BaseGauge { | ||
157 | 157 | ||
158 | draw() { | 158 | draw() { |
159 | try { | 159 | try { |
160 | + | ||
160 | let canvas = this.canvas; | 161 | let canvas = this.canvas; |
162 | + | ||
163 | + if (!canvas.drawWidth || !canvas.drawHeight) { | ||
164 | + return this; | ||
165 | + } | ||
166 | + | ||
161 | let [x, y, w, h] = [ | 167 | let [x, y, w, h] = [ |
162 | -canvas.drawX, | 168 | -canvas.drawX, |
163 | -canvas.drawY, | 169 | -canvas.drawY, |
@@ -181,7 +181,7 @@ function AlarmsTableWidgetController($element, $scope, $filter, $mdMedia, $mdDia | @@ -181,7 +181,7 @@ function AlarmsTableWidgetController($element, $scope, $filter, $mdMedia, $mdDia | ||
181 | vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true; | 181 | vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true; |
182 | 182 | ||
183 | var pageSize = vm.settings.defaultPageSize; | 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 | vm.defaultPageSize = pageSize; | 185 | vm.defaultPageSize = pageSize; |
186 | } | 186 | } |
187 | 187 |
@@ -167,7 +167,7 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $tra | @@ -167,7 +167,7 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $tra | ||
167 | vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true; | 167 | vm.displayPagination = angular.isDefined(vm.settings.displayPagination) ? vm.settings.displayPagination : true; |
168 | 168 | ||
169 | var pageSize = vm.settings.defaultPageSize; | 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 | vm.defaultPageSize = pageSize; | 171 | vm.defaultPageSize = pageSize; |
172 | } | 172 | } |
173 | 173 |
@@ -58,14 +58,17 @@ export default class TbImageMap { | @@ -58,14 +58,17 @@ export default class TbImageMap { | ||
58 | } | 58 | } |
59 | 59 | ||
60 | var imageMap = this; | 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 | testImage.onload = function() { | 63 | testImage.onload = function() { |
63 | imageMap.aspect = testImage.width / testImage.height; | 64 | imageMap.aspect = testImage.width / testImage.height; |
65 | + document.body.removeChild(testImage); //eslint-disable-line | ||
64 | imageMap.onresize(); | 66 | imageMap.onresize(); |
65 | if (initCallback) { | 67 | if (initCallback) { |
66 | setTimeout(initCallback, 0); //eslint-disable-line | 68 | setTimeout(initCallback, 0); //eslint-disable-line |
67 | } | 69 | } |
68 | } | 70 | } |
71 | + document.body.appendChild(testImage); //eslint-disable-line | ||
69 | testImage.src = imageUrl; | 72 | testImage.src = imageUrl; |
70 | } | 73 | } |
71 | 74 |
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | position: relative; | 52 | position: relative; |
53 | margin: auto; | 53 | margin: auto; |
54 | background: transparent no-repeat scroll 0 0; | 54 | background: transparent no-repeat scroll 0 0; |
55 | - background-size: cover; | 55 | + background-size: 100% 100%; |
56 | 56 | ||
57 | &.is-pointer { | 57 | &.is-pointer { |
58 | cursor: pointer !important; | 58 | cursor: pointer !important; |
@@ -51,7 +51,7 @@ module.exports = { | @@ -51,7 +51,7 @@ module.exports = { | ||
51 | new HtmlWebpackPlugin({ | 51 | new HtmlWebpackPlugin({ |
52 | template: './src/index.html', | 52 | template: './src/index.html', |
53 | filename: 'index.html', | 53 | filename: 'index.html', |
54 | - title: 'Thingsboard', | 54 | + title: 'ThingsBoard', |
55 | inject: 'body', | 55 | inject: 'body', |
56 | }), | 56 | }), |
57 | new webpack.optimize.OccurrenceOrderPlugin(), | 57 | new webpack.optimize.OccurrenceOrderPlugin(), |
@@ -47,7 +47,7 @@ module.exports = { | @@ -47,7 +47,7 @@ module.exports = { | ||
47 | new HtmlWebpackPlugin({ | 47 | new HtmlWebpackPlugin({ |
48 | template: './src/index.html', | 48 | template: './src/index.html', |
49 | filename: '../index.html', | 49 | filename: '../index.html', |
50 | - title: 'Thingsboard', | 50 | + title: 'ThingsBoard', |
51 | inject: 'body', | 51 | inject: 'body', |
52 | }), | 52 | }), |
53 | new webpack.optimize.OccurrenceOrderPlugin(), | 53 | new webpack.optimize.OccurrenceOrderPlugin(), |