diff --git a/ui/ui.js b/ui/ui.js index da8ed8d8..c4c06ab5 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -579,31 +579,27 @@ var FIELD_TYPES = { t = t == '' ? Math.random()+'' : t var item = field.find('.item').last() for(var i=0; i < value.length; i++){ - var txt = value[i] - // get options... - var opts = txt.split(/\|/g) - txt = opts[0].trim() - opts = opts - .slice(1) + var opts = value[i] + .split(/\|/g) .map(function(e){ return e.trim() }) var val = item.find('.value') - val.val(txt) + val.val(opts[0]) // set checked state... - if(opts.indexOf('default') >= 0){ + if(opts.slice(1).indexOf('default') >= 0){ val.prop('checked', true) opts.splice(opts.indexOf('default'), 1) } else { val.prop('checked', false) } - txt = item.find('.item-text') - .html(txt) + var txt = item.find('.item-text') + .html(opts[0]) // tooltip... - if(opts.length > 0){ + if(opts.length > 1){ $(' *') .attr('tooltip', opts.pop()) .appendTo(txt) @@ -834,16 +830,20 @@ function formDialog(root, message, config, btn, cls){ // NOTE: if first element is a radio button set, focus the checked // element, else focus the first input... form.ready(function(){ - var elem = form.find('.field input').first() - if(elem.attr('type') == 'radio'){ - form.find('.field input:checked') - .focus() - .select() - } else { - elem - .focus() - .select() - } + // NOTE: we are using a timeout to avoid the user input that opened + // the dialog to end up in the first field... + setTimeout(function(){ + var elem = form.find('.field input').first() + if(elem.attr('type') == 'radio'){ + form.find('.field input:checked') + .focus() + .select() + } else { + elem + .focus() + .select() + } + }, 100) }) return res diff --git a/ui/urlhistory.js b/ui/urlhistory.js index cab95e35..d10ba348 100755 --- a/ui/urlhistory.js +++ b/ui/urlhistory.js @@ -137,7 +137,9 @@ function recentlyOpenedDialog(){ updateStatus('Recently opened...').show() var dict = {} - var title = 'Recently opened:' + var title = 'Recently opened: | '+ + 'Shortcuts ctrl-shift-Left and ctrl-shift-Right can be used\n'+ + 'to move through this list from ribbon view.' var cfg = {} cfg[title] = BASE_URL_HISTORY.map(function(e){