From 26489591ab8df94d263ad2cc8a6df0a57c02a2f0 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Thu, 8 Aug 2013 14:02:59 +0800 Subject: [PATCH] MDL-35934 Filemanager: update set focus attribute. Also limit the display string for the dialog header to fit nicely on mobile devices --- lib/form/filemanager.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index 4f966ce0649..7e1ac30bf56 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -1017,9 +1017,17 @@ M.form_filemanager.init = function(Y, options) { } }, false); } + // update dialog header + var nodename = node.fullname; + // Limit the string length so it fits nicely on mobile devices + var namelength = 50; + if (nodename.length > namelength) { + nodename = nodename.substring(0, namelength) + '...'; + } + Y.one('#fm-dialog-label_'+selectnode.get('id')).setContent(Y.Escape.html(M.str.moodle.edit+' '+nodename)); // show panel this.selectui.show(); - document.getElementById(this.selectui.get('id')).focus(); + Y.one('#'+selectnode.get('id')).focus(); }, render: function() { this.print_path();