Started directive to make form read-only
This commit is contained in:
parent
98629ac6f8
commit
8d5d786452
1 changed files with 14 additions and 14 deletions
|
@ -672,20 +672,6 @@ module.directive('kcInput', function() {
|
|||
return d;
|
||||
});
|
||||
|
||||
module.directive('kcDisableForm', function() {
|
||||
var d = {
|
||||
scope : true,
|
||||
replace : false,
|
||||
link : function(scope, element, attrs) {
|
||||
var form = element.children('form');
|
||||
console.debug(form);
|
||||
var input = element.children('input');
|
||||
input.attr('disabled', 'true');
|
||||
}
|
||||
};
|
||||
return d;
|
||||
});
|
||||
|
||||
module.directive('kcEnter', function() {
|
||||
return function(scope, element, attrs) {
|
||||
element.bind("keydown keypress", function(event) {
|
||||
|
@ -791,6 +777,20 @@ module.directive('kcSelect', function ($compile, Notifications) {
|
|||
}
|
||||
});
|
||||
|
||||
module.directive('kcReadOnly', function() {
|
||||
var d = {
|
||||
replace : false,
|
||||
link : function(scope, element, attrs) {
|
||||
if (scope.$eval(attrs.kcReadOnly)) {
|
||||
element.find('input').attr('disabled', 'disabled');
|
||||
element.find('button').attr('disabled', 'disabled');
|
||||
element.find('select').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
};
|
||||
return d;
|
||||
});
|
||||
|
||||
module.directive('kcNavigation', function ($compile, Notifications) {
|
||||
return {
|
||||
scope: true,
|
||||
|
|
Loading…
Reference in a new issue