Fix maxchars javascript errors on macro parameter editors

This commit is contained in:
Bjarne Fyrstenborg
2017-08-14 19:57:28 +02:00
parent ef0d6eff2c
commit c68d7a33ca
2 changed files with 24 additions and 2 deletions

View File

@@ -1,4 +1,15 @@
function textAreaController($rootScope, $scope, $log) {
function textAreaController($scope) {
// macro parameter editor doesn't contains a config object,
// so we create a new one to hold any properties
if (!$scope.model.config) {
$scope.model.config = {};
}
if (!$scope.model.config.maxChars) {
$scope.model.config.maxChars = false;
}
$scope.model.maxlength = false;
if($scope.model.config.maxChars) {
$scope.model.maxlength = true;

View File

@@ -1,4 +1,15 @@
function textboxController($rootScope, $scope, $log) {
function textboxController($scope) {
// macro parameter editor doesn't contains a config object,
// so we create a new one to hold any properties
if (!$scope.model.config) {
$scope.model.config = {};
}
if (!$scope.model.config.maxChars) {
$scope.model.config.maxChars = false;
}
$scope.model.maxlength = false;
if($scope.model.config.maxChars) {
$scope.model.maxlength = true;