Commit b314a3fe authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1908628: Allow block configure title to be autoselected



So we can change it quicker

Also fixing up how the view does it now that I understand how it's
suppose to be done

Change-Id: I38b2ebf2fe2cb7060833eb7c771eb82380e5a23a
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 4af5f658
......@@ -1547,7 +1547,8 @@ class BlockInstance {
'defaultvalue' => $title,
'rules' => array('maxlength' => 255),
'hidewhenempty' => $hasdefault,
'expandtext' => get_string('setblocktitle'),
'expandtext' => get_string('setblocktitle'),
'autoselect' => true,
);
}
$elements = array_merge(
......
......@@ -420,9 +420,6 @@ function basename(path) {
jQuery(function($) {
// Autofocus the first element with a class of 'autofocus' on page load (@todo: move this to pieforms.js)
$('.autofocus').first().trigger("focus");
if ($('.autofocus').first().trigger("focus").prop('id') == 'settings_title' && getUrlParameter('new', window.location.href)) {
$('.autofocus').first().trigger('select');
}
});
// Contextual Help
......
......@@ -225,7 +225,7 @@ function create_settings_pieform() {
}
function get_basic_elements() {
global $view, $urlallowed, $group, $institution, $USER;
global $view, $urlallowed, $group, $institution, $USER, $new;
$createtagsoptions = array();
$typecast = is_postgres() ? '::varchar' : '';
......@@ -252,6 +252,7 @@ function get_basic_elements() {
'title' => get_string('title','view'),
'defaultvalue' => $view->get('title'),
'rules' => array( 'required' => true ),
'autoselect' => $new,
),
'description' => array(
'type' => 'textarea',
......
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