Opened 10 years ago
Closed 10 years ago
#12302 closed Bug (duplicate)
Action buttons are not disabling in IE
Reported by: | Raghav | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Read-only | Version: | |
Keywords: | Cc: |
Description
This is the ref#12299 and I am attaching the code for it.
Below is code for this, <!doctype html> <html> <head>
<title>CkEditor</title>
</head> <body ng-app='myApp'>
<div ng-controller="MyCtrl">
<div ng-repeat="editor in editors">
<textarea id="{{editor.id}}"
data-ng-model="editor.content" value="{{editor.content}}" name="{{editor.name}}" style="width:670px !important" is-read-only="{{editor.isReadOnly}}" data-ck-editor></textarea>
<br />
</div>
</div>
</body> </html> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script> <script src="cdn.ckeditor.com/4.4.3/standard/ckeditor.js"></script> <script language="javascript">
var app = angular.module("myApp", []); app.controller('MyCtrl', function ($scope) {
$scope.option = true; $scope.editors = [
{
id: 'sample1', content: 'sample 1 content ENABLED', name: 'sample1', isReadOnly: false,
}, {
id: 'sample2', content: 'sample 2 content DISABLED', name: 'sample2', isReadOnly: true,
}
];
}).directive('ckEditor', [
function () {
return {
require: '?ngModel', link: function ($scope, elm, attr, ngModel) {
var selectedElement = elm[0]; if (selectedElement !== null && selectedElement !== undefined) {
var loadCk = function () {
ck.on('pasteState', function () {
$scope.$apply(function () {
ngModel.$setViewValue(ck.getData());
});
}); wait until the editor has done initializing ck.on("instanceReady", function () {
insert code to run after editor is ready ck.setData(ngModel.$modelValue); if (attr.isReadOnly) {
if (attr.isReadOnly === 'true')
ck.setReadOnly(true);
else
ck.setReadOnly(false);
}
}); ngModel.$render = function () {
ck.setData(ngModel.$modelValue); ck.focus();
};
}
if (attr.id)
elm[0].id = attr.id;
if (attr.name)
elm[0].name = attr.name;
if (attr.value) {
ngModel.$modelValue = attr.value;
} var ck = CKEDITOR.replace(elm[0]); loadCk();
}
}
};
}
]);
</script>
Change History (1)
comment:1 Changed 10 years ago by
Keywords: | IE SetReadonly removed |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Version: | 4.4.3 |
DUP of #12303