Commit 261d386d authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1467252: Fix display problem with Switchbox



When switchbox is outside pieforms

behatnotneeded

Change-Id: I5c8d53fba46267a16b70b7d288f18488cdd82b29
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 5f5e1427
...@@ -470,14 +470,6 @@ abstract class ArtefactTypeFileBase extends ArtefactType { ...@@ -470,14 +470,6 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
return 'file'; return 'file';
} }
public static function get_switch_width() {
$on = get_string('on', 'mahara');
$off = get_string('off', 'mahara');
$strlength = max(strlen($on), strlen($off));
return floor(57 + (($strlength - 2) * 3.5) + pow(1.4, ($strlength - 2))) . 'px';
}
public function move($newparentid) { public function move($newparentid) {
$this->set('parent', $newparentid); $this->set('parent', $newparentid);
$this->commit(); $this->commit();
......
...@@ -205,9 +205,6 @@ function pieform_element_filebrowser(Pieform $form, $element) { ...@@ -205,9 +205,6 @@ function pieform_element_filebrowser(Pieform $form, $element) {
$params .= '&institution=' . $institution; $params .= '&institution=' . $institution;
} }
$switchwidth = ArtefactTypeFileBase::get_switch_width();
$smarty->assign('switchwidth',$switchwidth);
$smarty->assign('folderparams', $params); $smarty->assign('folderparams', $params);
return $smarty->fetch('artefact:file:form/filebrowser.tpl'); return $smarty->fetch('artefact:file:form/filebrowser.tpl');
...@@ -328,8 +325,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h ...@@ -328,8 +325,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
} }
$smarty->assign('downloadfolderaszip', $addzipdownloadlink); $smarty->assign('downloadfolderaszip', $addzipdownloadlink);
$switchwidth = ArtefactTypeFileBase::get_switch_width();
$smarty->assign('edit', -1); $smarty->assign('edit', -1);
$smarty->assign('highlight', $highlight); $smarty->assign('highlight', $highlight);
$smarty->assign('editable', $editable); $smarty->assign('editable', $editable);
...@@ -339,7 +334,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h ...@@ -339,7 +334,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
$smarty->assign('showtags', $showtags); $smarty->assign('showtags', $showtags);
$smarty->assign('editmeta', $editmeta); $smarty->assign('editmeta', $editmeta);
$smarty->assign('filelist', $filedata); $smarty->assign('filelist', $filedata);
$smarty->assign('switchwidth', $switchwidth);
$smarty->assign('querybase', $querybase); $smarty->assign('querybase', $querybase);
$smarty->assign('prefix', $prefix); $smarty->assign('prefix', $prefix);
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
</label> </label>
</div> </div>
</div> </div>
<script type="application/javascript">Switchbox.computeWidth("{$prefix}_edit_allowcomments");</script>
</div> </div>
<div> <div>
<div class="submitcancel form-group"> <div class="submitcancel form-group">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment