Commit 92c1374a3f31a31b9492a192d65a740b67352c16

Authored by Vladyslav
Committed by Igor Kulikov
1 parent 45a4c6f3

Fix knob control widget (#2298)

* Add support import label

* Fix knob control widget
... ... @@ -162,14 +162,12 @@ export default function AppRun($rootScope, $window, $injector, $location, $log,
162 162 if (forbiddenDialog === null) {
163 163 $translate(['access.access-forbidden',
164 164 'access.access-forbidden-text',
165   - 'access.access-forbidden',
166 165 'action.cancel',
167 166 'action.sign-in']).then(function (translations) {
168 167 if (forbiddenDialog === null) {
169 168 forbiddenDialog = $mdDialog.confirm()
170 169 .title(translations['access.access-forbidden'])
171 170 .htmlContent(translations['access.access-forbidden-text'])
172   - .ariaLabel(translations['access.access-forbidden'])
173 171 .cancel(translations['action.cancel'])
174 172 .ok(translations['action.sign-in']);
175 173 $mdDialog.show(forbiddenDialog).then(function () {
... ...
... ... @@ -328,6 +328,9 @@ function KnobController($element, $scope, $document) {
328 328 var textWidth = measureTextWidth(text, fontSize);
329 329 while (textWidth > maxWidth) {
330 330 fontSize--;
  331 + if (fontSize < 0) {
  332 + break;
  333 + }
331 334 textWidth = measureTextWidth(text, fontSize);
332 335 }
333 336 element.css({'fontSize': fontSize+'px', 'lineHeight': fontSize+'px'});
... ... @@ -335,7 +338,7 @@ function KnobController($element, $scope, $document) {
335 338
336 339 function measureTextWidth(text, fontSize) {
337 340 textMeasure.css({'fontSize': fontSize+'px', 'lineHeight': fontSize+'px'});
338   - textMeasure.text(text);
  341 + textMeasure.html(text);
339 342 return textMeasure.width();
340 343 }
341 344
... ...
... ... @@ -29,7 +29,7 @@
29 29 <div class="top"></div>
30 30 <div class="error-container" ng-style="{'background': vm.error.length ? 'rgba(255,255,255,0.25)' : 'none'}"
31 31 layout="row" layout-align="center center">
32   - <span class="knob-error">{{ vm.error }}</span>
  32 + <span class="knob-error" ng-bind-html="vm.error"></span>
33 33 </div>
34 34 <div class="title-container" layout="row" layout-align="center center">
35 35 <span class="knob-title">{{ vm.title }}</span>
... ... @@ -42,4 +42,4 @@
42 42 <div id="text-measure"></div>
43 43 </div>
44 44 </div>
45   -</div>
\ No newline at end of file
  45 +</div>
... ...