Commit 91f981e9d961b372f7050e6c1b7f71222c13c7cb

Authored by Megan Watson
2 parents 070fbb0a bd225cba

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

Showing 1 changed file with 11 additions and 2 deletions
plugins/ktcore/KTWidgets.php
@@ -944,8 +944,17 @@ class KTCoreTextAreaWidget extends KTWidget { @@ -944,8 +944,17 @@ class KTCoreTextAreaWidget extends KTWidget {
944 $global_required_default = true; 944 $global_required_default = true;
945 $this->bRequired = (KTUtil::arrayGet($aOptions, 'required', $global_required_default, false) == true); 945 $this->bRequired = (KTUtil::arrayGet($aOptions, 'required', $global_required_default, false) == true);
946 946
947 - $this->aOptions['cols'] = KTUtil::arrayGet($aOptions, 'cols', 60);  
948 - $this->aOptions['rows'] = KTUtil::arrayGet($aOptions, 'rows', 3); 947 + // Part of the space on the mce editor is taken up by the toolbars, so make the plain text field slightly smaller (if using the default size)
  948 + $default_rows = 20;
  949 + if(isset($this->aOptions['field'])){
  950 + $oField = $this->aOptions['field'];
  951 + if(!$oField->getIsHTML()){
  952 + $default_rows = 15;
  953 + }
  954 + }
  955 +
  956 + $this->aOptions['cols'] = KTUtil::arrayGet($aOptions, 'cols', 80);
  957 + $this->aOptions['rows'] = KTUtil::arrayGet($aOptions, 'rows', $default_rows);
949 $this->aOptions['field'] = KTUtil::arrayGet($aOptions, 'field'); 958 $this->aOptions['field'] = KTUtil::arrayGet($aOptions, 'field');
950 } 959 }
951 960