From 024f4255dee3370b7ec2cd84beb36f9ae98ad848 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 13 Dec 2013 04:55:57 +0400 Subject: [PATCH] fixed a bug in url history dialog... Signed-off-by: Alex A. Naanou --- ui/ui.js | 4 ++-- ui/urlhistory.js | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ui/ui.js b/ui/ui.js index bf6ca30c..fbcae805 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -732,8 +732,8 @@ var FIELD_TYPES = { var values = field.find('.value') .attr('name', t) // set the default... - if(values.filter(':checked').length == 0){ - values.first() + if(values.filter(':checked:not([disabled])').length == 0){ + values.filter(':not([disabled])').first() .prop('checked', true) } }, diff --git a/ui/urlhistory.js b/ui/urlhistory.js index 61176c49..d3852b60 100755 --- a/ui/urlhistory.js +++ b/ui/urlhistory.js @@ -185,16 +185,22 @@ function recentlyOpenedDialog(){ cfg[title] = BASE_URL_HISTORY.map(function(e){ // cleanup the urls... var ee = e.replace('file:///', '') + var disabled = not_available.indexOf(e) >= 0 // mark disabled... - if(not_available.indexOf(e) >= 0){ + if(disabled){ ee = ''+ee+'' - dict[ee] = e - return ee + ' | disabled | Not available.' - } + if(e == BASE_URL){ + dict[ee] = e + return ee + ' | disabled | Currently loaded, path not available.' + + } else { + dict[ee] = e + return ee + ' | disabled | Not available.' + } // mark the current path... - if(e == BASE_URL){ + } else if(e == BASE_URL){ ee = ee.italics() dict[ee] = e return ee + ' | default | Currently loaded data.'