autoheight.js 1.1 KB

12345678910111213141516171819202122232425262728
  1. module('plugins.autoheight');
  2. test('自动长高',function(){
  3. var sc = document.createElement("script");
  4. sc.id="sc";
  5. sc.type = "text/plain";
  6. document.body.appendChild(sc);
  7. var editor = new UE.ui.Editor({'autoFloatEnabled':true,'topOffset':60,'autoHeightEnabled':true,'scaleEnabled':false});
  8. editor.render('sc');
  9. te.dom[0].parentNode.removeChild(te.dom[0]);
  10. stop();
  11. setTimeout(function(){
  12. var height=editor.body.style.height;
  13. editor.setContent('<br/>nmnmknmm,<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>');
  14. setTimeout(function(){
  15. ok(height!=editor.body.style.height,'自动长高');
  16. editor.disableAutoHeight();
  17. editor.body.style.height=height;
  18. editor.setContent('<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>');
  19. stop();
  20. setTimeout(function(){
  21. ok(height==editor.body.style.height,'不长高');
  22. start();
  23. },200);
  24. },200);
  25. },800);
  26. });