我正在使用javascript ckEditor,我有一个调整大小的问题,这个问题一直是过去几天讨论的问题。 我有一个名为ckEditorConfig的角度对象,我在那里存储我的ckEditor的配置。目前我可以看到一些属性被设置(所以我知道它在某种程度上有效)。但是,当我尝试调整编辑器的大小时,它不会调整到我想要的级别。JavaScript调整CK编辑器不能正常工作
这里有一个片段的的HTML和JS代码到更多的光线添加到我谈论什么:
这是包含在我的控制器
$scope.ckEditorConfig = { uiColor : '#FFFFFF', toolbarGroups: [ { name: 'undo' } ], removeButtons: '', extraPlugins: 'font,sourcedialog,sourcearea,stylescombo,colorbutton, colordialog', contentsCss: '/path/to/css', customConfig: '/path/to/js', width: 561, height: 150 }; websiteApp.directive('ckEditor', ['$timeout', function ($timeout) { return { require: '?ngModel', link: function ($scope, elm, attr, ngModel) { var ck = CKEDITOR.replace(elm[0]); if($scope.ckEditorConfig){ $.each($scope.ckEditorConfig, function(key, value){ ck.config[key] = value; }); } var height = ck.config.height; var width = ck.config.width; if(height && width){ ck.on('instanceReady', function(event){ var editor = event.editor; console.log('ck height: '+ height+', ck width: '+width); console.log('editor config height: '+ editor.config.height+', editor config width: '+editor.config.width); editor.resize(editor.config.width, editor.config.height, false, false); }); // ck.resize(height, width, true, false); } } };
}]) ;
,我有这个在我的HTML
> <textarea id="fflFieldLabel" class="txtArea" rows="1"
> ng-model="{{ngmodel}}" ck-editor></textarea>
没有,没有任何区别 – dlimestar