我正在使用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