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 attrs.$observe("umbAutoFocus", function (newVal) {
//use auto focus. var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true;
if (attrs.umbAutoFocus) { if (enabled) {
attrs.$observe("umbAutoFocus", function (newVal) { $timeout(function() {
var enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true; update();
if (enabled) { });
$timeout(function() { }
update(); });
});
}
});
}
}; };
}); });