Skip to content

Commit

Permalink
fix(errors): reduce console errors
Browse files Browse the repository at this point in the history
THIN-12080
  • Loading branch information
rothmike committed Sep 27, 2018
1 parent ba46947 commit aa0a6f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions src/os/ui/util/autovheight.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ os.ui.Module.directive('autovheight', [os.ui.util.autoVHeightDirective]);
* @param {!angular.Scope} $scope
* @param {!angular.JQLite} $element
* @param {!angular.$injector} $injector
* @param {!angular.$timeout} $timeout
* @constructor
* @ngInject
*/
os.ui.util.AutoVHeightCtrl = function($scope, $element, $injector) {
os.ui.util.AutoVHeightCtrl = function($scope, $element, $injector, $timeout) {
/**
* @type {?angular.Scope}
* @private
Expand All @@ -80,10 +81,7 @@ os.ui.util.AutoVHeightCtrl = function($scope, $element, $injector) {
var parent = $element.parent();
parent.resize(this.resizeFn_);

var siblings = /** @type {string} */ ($scope['siblings']);
if (siblings) {
$(siblings).resize(this.resizeFn_);
}
$timeout(this.resizeSiblings_.bind(this));

// add resize to common elements
goog.object.getValues(os.ui.windowCommonElements).forEach(function(sibling) {
Expand Down Expand Up @@ -151,3 +149,15 @@ os.ui.util.AutoVHeightCtrl.prototype.onResize_ = function() {
this.element_.css('height', vhHeight);
}
};


/**
* Add resize handlers to siblings
* @private
*/
os.ui.util.AutoVHeightCtrl.prototype.resizeSiblings_ = function() {
var siblings = /** @type {string} */ (this.scope_['siblings']);
if (siblings) {
$(siblings).resize(this.resizeFn_);
}
};
4 changes: 2 additions & 2 deletions views/layer/layerpicker.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<select ng-if="!pickerCtrl.multiple()" ng-model="layer" ng-options="l.getId() for l in pickerCtrl.layersList"
ng-change="pickerCtrl.layerPicked(layer)" class="js-layer-picker w-100" ng-required="isRequired"/>
<select ng-if="pickerCtrl.multiple()" ng-model="layers" ng-options="l.getId() for l in pickerCtrl.layersList"
ng-change="pickerCtrl.layersChanged(layers)" class="js-layer-picker w-100" multiple/>
<select ng-if="pickerCtrl.multiple()" ng-model="pickerCtrl.layers" ng-options="l.getId() for l in pickerCtrl.layersList"
ng-change="pickerCtrl.layersChanged(pickerCtrl.layers)" class="js-layer-picker w-100" multiple/>
</div>

0 comments on commit aa0a6f6

Please sign in to comment.