MDL-41200 filepicker: change header string to select.

Add length limitation for header, so it fits nicely in mobile devices
This commit is contained in:
Rossiani Wijaya 2013-08-15 01:04:50 +08:00
parent 702d1f853e
commit 0a5c86ddef
2 changed files with 9 additions and 3 deletions

View File

@ -658,7 +658,7 @@ class page_requirements_manager {
array('nofilesavailable', 'repository'), array('norepositoriesavailable', 'repository'),
array('fileexistsdialogheader', 'repository'), array('fileexistsdialog_editor', 'repository'),
array('fileexistsdialog_filemanager', 'repository'), array('renameto', 'repository'),
array('referencesexist', 'repository'), array('edit', 'moodle')
array('referencesexist', 'repository'), array('select', 'moodle')
));
break;
case 'core_comment':

View File

@ -1062,7 +1062,13 @@ M.core_filepicker.init = function(Y, options) {
}, false);
},
select_file: function(args) {
Y.one('#fp-file_label_'+this.options.client_id).setContent(Y.Escape.html(M.str.moodle.edit+' '+args.title));
var argstitle = args.title;
// Limit the string length so it fits nicely on mobile devices
var titlelength = 50;
if (argstitle.length > titlelength) {
argstitle = argstitle.substring(0, titlelength) + '...';
}
Y.one('#fp-file_label_'+this.options.client_id).setContent(Y.Escape.html(M.str.moodle.select+' '+argstitle));
this.selectui.show();
Y.one('#'+this.selectnode.get('id')).focus();
var client_id = this.options.client_id;
@ -1306,7 +1312,7 @@ M.core_filepicker.init = function(Y, options) {
var fplabel = 'fp-file_label_'+ client_id;
this.selectui = new M.core.dialogue({
headerContent: '<span id="' + fplabel +'">'+M.str.moodle.edit+'</span>',
headerContent: '<span id="' + fplabel +'">'+M.str.moodle.select+'</span>',
draggable : true,
bodyContent : this.selectnode,
centered : true,