empty value should also enable in order to stay backwards compatible.

This commit is contained in:
Niels Lyngsø
2021-01-20 10:15:52 +01:00
committed by Sebastiaan Janssen
parent b75a237162
commit 2321fbfcab

View File

@@ -10,18 +10,14 @@ angular.module("umbraco.directives")
}
};
//check if there's a value for the attribute, if there is and it's false then we conditionally don't
//use auto focus.
if (attrs.umbAutoFocus) {
attrs.$observe("umbAutoFocus", function (newVal) {
var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true;
if (enabled) {
$timeout(function() {
update();
});
}
});
}
attrs.$observe("umbAutoFocus", function (newVal) {
var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true;
if (enabled) {
$timeout(function() {
update();
});
}
});
};
});