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: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 5f5e1427
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -470,14 +470,6 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
        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) {
        $this->set('parent', $newparentid);
        $this->commit();
+0 −6
Original line number Diff line number Diff line
@@ -205,9 +205,6 @@ function pieform_element_filebrowser(Pieform $form, $element) {
        $params .= '&institution=' . $institution;
    }

    $switchwidth = ArtefactTypeFileBase::get_switch_width();
    $smarty->assign('switchwidth',$switchwidth);

    $smarty->assign('folderparams', $params);

    return $smarty->fetch('artefact:file:form/filebrowser.tpl');
@@ -328,8 +325,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
    }
    $smarty->assign('downloadfolderaszip', $addzipdownloadlink);

    $switchwidth = ArtefactTypeFileBase::get_switch_width();

    $smarty->assign('edit', -1);
    $smarty->assign('highlight', $highlight);
    $smarty->assign('editable', $editable);
@@ -339,7 +334,6 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
    $smarty->assign('showtags', $showtags);
    $smarty->assign('editmeta', $editmeta);
    $smarty->assign('filelist', $filedata);
    $smarty->assign('switchwidth', $switchwidth);
    $smarty->assign('querybase', $querybase);
    $smarty->assign('prefix', $prefix);

+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@
                    </label>
                    </div>
                </div>
                <script type="application/javascript">Switchbox.computeWidth("{$prefix}_edit_allowcomments");</script>
            </div>
        <div>
        <div class="submitcancel form-group">